diff options
Diffstat (limited to 'jimbrella/config.py')
-rw-r--r-- | jimbrella/config.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/jimbrella/config.py b/jimbrella/config.py index dd4aa00..48265e9 100644 --- a/jimbrella/config.py +++ b/jimbrella/config.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import toml config_path = ( @@ -11,18 +12,20 @@ f = open(config_path) config = toml.load(f) f.close() +JIMBRELLA_DIR = Path(config["jimbrella_dir"]) + FLASK_SECRET_KEY = config["flask"]["secret_key"] ACCEPT_NEW_USERS = config["user"]["accept_new_users"] -JFORM_TAKEAWAY_URL = config["jform"]["takeaway_url"] -JFORM_GIVEBACK_URL = config["jform"]["giveback_url"] -JFORM_BOOKMARK_DIR = config["jform"]["bookmark_dir"] +JFORM_TAKEAWAY_URL = JIMBRELLA_DIR / Path(config["jform"]["takeaway_url"]) +JFORM_GIVEBACK_URL = JIMBRELLA_DIR / Path(config["jform"]["giveback_url"]) +JFORM_BOOKMARK_DIR = JIMBRELLA_DIR / Path(config["jform"]["bookmark_dir"]) -DATABASE_PATH = config["db"]["db_path"] -USERS_PATH = config["db"]["users_path"] +DATABASE_PATH = JIMBRELLA_DIR / Path(config["db"]["db_path"]) +USERS_PATH = JIMBRELLA_DIR / Path(config["db"]["users_path"]) DUE_HOURS = config["rules"]["due_hours"] -LOG_PATH = config["logging"]["log_path"] -ADMIN_LOG_PATH = config["logging"]["admin_log_path"] +LOG_PATH = JIMBRELLA_DIR / Path(config["logging"]["log_path"]) +ADMIN_LOG_PATH = JIMBRELLA_DIR / Path(config["logging"]["admin_log_path"]) |