MCPcopy Create free account
hub / github.com/stemdeckapp/stemdeck / _load

Function _load

app/core/settings.py:47–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46
47def _load() -> dict:
48 try:
49 data = json.loads(_SETTINGS_PATH.read_text(encoding="utf-8"))
50 if isinstance(data, dict):
51 return data
52 except FileNotFoundError:
53 pass # no settings file yet — first run; use defaults
54 except Exception:
55 # Corrupt/unreadable file: fall back to defaults rather than crash.
56 _log.warning("could not read settings from %s", _SETTINGS_PATH, exc_info=True)
57 return {}
58
59
60def _ensure() -> dict:

Callers 1

_ensureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected