added claude folder and removed project root constant
This commit is contained in:
1 parent
66dc759f91
commit
e04909ebad
1 file changed
+6
-6
@@ -27,14 +27,14 @@ def get_bot_token(is_production: bool) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_config(
|
def get_config(
|
||||||
monitor_name: str, use_production_path: bool = False
|
monitor_name: str,
|
||||||
|
config_dir: str | pathlib.Path = "configs",
|
||||||
|
test_config_dir: str | pathlib.Path = "tests/configs",
|
||||||
|
use_production_path: bool = False,
|
||||||
) -> tuple[dict, pathlib.Path]:
|
) -> tuple[dict, pathlib.Path]:
|
||||||
monitor_name = monitor_name.replace(".json", "")
|
monitor_name = monitor_name.replace(".json", "")
|
||||||
if use_production_path:
|
base = config_dir if use_production_path else test_config_dir
|
||||||
config_path = PROJECT_ROOT / "configs" / f"{monitor_name}.json"
|
config_path = pathlib.Path(base) / f"{monitor_name}.json"
|
||||||
else:
|
|
||||||
config_path = PROJECT_ROOT / "tests" / "configs" / f"{monitor_name}.json"
|
|
||||||
|
|
||||||
with open(config_path) as f:
|
with open(config_path) as f:
|
||||||
return json.load(f), config_path
|
return json.load(f), config_path
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user