MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / load_config

Function load_config

Scripts/Developer Base/Mobile Desktop.py:585–597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

583# Utilities
584# ----------------------------
585def load_config() -> Dict:
586 APP_DIR.mkdir(parents=True, exist_ok=True)
587 if not CONFIG_PATH.exists():
588 save_config(DEFAULT_CONFIG)
589 try:
590 cfg = json.loads(CONFIG_PATH.read_text(encoding="utf-8"))
591 if "systems" not in cfg:
592 cfg["systems"] = {}
593 cfg["language"] = "en"
594 return cfg
595 except Exception:
596 save_config(DEFAULT_CONFIG)
597 return dict(DEFAULT_CONFIG)
598
599def save_config(cfg: Dict) -> None:
600 APP_DIR.mkdir(parents=True, exist_ok=True)

Callers 1

mainFunction · 0.70

Calls 1

save_configFunction · 0.70

Tested by

no test coverage detected