DIANA_CFG_DIR -> ARTEMIS_CFG_DIR

This commit is contained in:
2024-04-21 04:57:58 +00:00
parent 752d27b30a
commit 2d0c26c6ca
4 changed files with 8 additions and 3 deletions

View File

@ -841,7 +841,7 @@ class DLReport:
return True return True
cfg_dir = environ.get("DIANA_CFG_DIR", "config") cfg_dir = environ.get("ARTEMIS_CFG_DIR", "config")
cfg: CoreConfig = CoreConfig() cfg: CoreConfig = CoreConfig()
if path.exists(f"{cfg_dir}/core.yaml"): if path.exists(f"{cfg_dir}/core.yaml"):
cfg.update(yaml.safe_load(open(f"{cfg_dir}/core.yaml"))) cfg.update(yaml.safe_load(open(f"{cfg_dir}/core.yaml")))

View File

@ -823,7 +823,7 @@ class FE_Machine(FE_Base):
arcade={} arcade={}
), media_type="text/html; charset=utf-8") ), media_type="text/html; charset=utf-8")
cfg_dir = environ.get("DIANA_CFG_DIR", "config") cfg_dir = environ.get("ARTEMIS_CFG_DIR", "config")
cfg: CoreConfig = CoreConfig() cfg: CoreConfig = CoreConfig()
if path.exists(f"{cfg_dir}/core.yaml"): if path.exists(f"{cfg_dir}/core.yaml"):
cfg.update(yaml.safe_load(open(f"{cfg_dir}/core.yaml"))) cfg.update(yaml.safe_load(open(f"{cfg_dir}/core.yaml")))

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
from os import mkdir, path, access, W_OK import os
from os import path
import yaml import yaml
import asyncio import asyncio
@ -31,6 +32,8 @@ if __name__ == "__main__":
cfg_dict.get("database", {})["loglevel"] = "info" cfg_dict.get("database", {})["loglevel"] = "info"
cfg.update(cfg_dict) cfg.update(cfg_dict)
os.environ["ARTEMIS_CFG_DIR"] = args.config
core.logger.init_root_logger(cfg) core.logger.init_root_logger(cfg)
data = Data(cfg) data = Data(cfg)

View File

@ -92,6 +92,8 @@ if __name__ == "__main__":
if path.exists(f"{args.config}/core.yaml"): if path.exists(f"{args.config}/core.yaml"):
config.update(yaml.safe_load(open(f"{args.config}/core.yaml"))) config.update(yaml.safe_load(open(f"{args.config}/core.yaml")))
os.environ["ARTEMIS_CFG_DIR"] = args.config
logger = logger.create_logger( logger = logger.create_logger(
"Reader", "Reader",
logging.DEBUG if config.server.is_develop else logging.INFO logging.DEBUG if config.server.is_develop else logging.INFO