MCPcopy
hub / github.com/MemPalace/mempalace / load

Method load

mempalace/entity_registry.py:308–316  ·  view source on GitHub ↗
(cls, config_dir: Optional[Path] = None)

Source from the content-addressed store, hash-verified

306
307 @classmethod
308 def load(cls, config_dir: Optional[Path] = None) -> "EntityRegistry":
309 path = (Path(config_dir) / "entity_registry.json") if config_dir else cls.DEFAULT_PATH
310 if path.exists():
311 try:
312 data = json.loads(path.read_text(encoding="utf-8"))
313 return cls(data, path)
314 except (json.JSONDecodeError, OSError):
315 pass
316 return cls(cls._empty(), path)
317
318 def save(self):
319 self._path.parent.mkdir(parents=True, exist_ok=True)

Callers 15

__init__Method · 0.45
people_mapMethod · 0.45
_load_tunnelsFunction · 0.45
run_onboardingFunction · 0.45
quick_setupFunction · 0.45
_load_known_namesFunction · 0.45
run_hookFunction · 0.45
_read_endpointFunction · 0.45
_load_hallwaysFunction · 0.45
from_configMethod · 0.45
compress_fileMethod · 0.45
compress_allMethod · 0.45

Calls 1

_emptyMethod · 0.80