summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hydrilla/server/config.py5
-rw-r--r--src/hydrilla/server/serve.py8
2 files changed, 7 insertions, 6 deletions
diff --git a/src/hydrilla/server/config.py b/src/hydrilla/server/config.py
index 4b5bcd7..0155e83 100644
--- a/src/hydrilla/server/config.py
+++ b/src/hydrilla/server/config.py
@@ -68,7 +68,10 @@ config_schema = {
}
}
-def load(config_paths: list[Path], can_fail: list[bool]=[]) -> dict:
+here = Path(__file__).resolve().parent
+
+def load(config_paths: list[Path]=[here / 'config.json'],
+ can_fail: list[bool]=[]) -> dict:
config = {}
bools_missing = max(0, len(config_paths) - len(can_fail))
diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py
index a5cdee8..075eaef 100644
--- a/src/hydrilla/server/serve.py
+++ b/src/hydrilla/server/serve.py
@@ -570,12 +570,10 @@ def start(malcontent_dir: Optional[str], hydrilla_project_url: Optional[str],
port: Optional[int], config_path: Optional[str],
language: Optional[str]) -> None:
"""<this will be replaced by a localized docstring for Click to pick up>"""
- if config_path is None:
- config_path = here / 'config.json'
- else:
- config_path = Path(config)
+ config_load_opts = {} if config_path is None \
+ else {'config_path': [Path(config_path)]}
- hydrilla_config = config.load([config_path])
+ hydrilla_config = config.load(**config_load_opts)
if malcontent_dir is not None:
hydrilla_config['malcontent_dir'] = str(Path(malcontent_dir).resolve())