-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename settings.yaml to goosebit.yaml, and check multiple places for …
…settings. Use can now pass `GOOSEBIT_SETTINGS` to customize settings location, as well as goosebit auto checking `/etc/goosebit` if it exists, the root of the project directory, and the current working directory when it is run. This should allow for more optionality when loading settings files. Renaming settings to `goosebit.yaml` is mainly to specify what the file is when running from CWD, it should be distinct from other files.
- Loading branch information
Showing
4 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import logging | ||
|
||
from .const import BASE_DIR, CONFIG_DIR, PWD_CXT # noqa: F401 | ||
from .const import PWD_CXT # noqa: F401 | ||
from .schema import GooseBitSettings | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
if not (BASE_DIR.joinpath("settings.yaml").exists() or CONFIG_DIR.joinpath("settings.yaml").exists()): | ||
logging.warning( | ||
"Could not find settings files, using default settings. " | ||
f"Please set a config in {CONFIG_DIR.joinpath('settings.yaml')}." | ||
) | ||
|
||
config = GooseBitSettings() | ||
|
||
USERS = {u.username: u for u in config.users} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters