MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / load

Method load

src/hooks/config_manager.py:317–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

315 return self._snapshot
316
317 async def load(self) -> HookConfigSnapshot:
318 snapshot = load_hooks_from_settings(self._settings_path)
319 self._snapshot = snapshot
320
321 await self._registry.clear_source(HookSource.USER_SETTINGS)
322
323 for event_name, hook_configs in snapshot.hooks.items():
324 for config in hook_configs:
325 if event_name in ALL_HOOK_EVENTS:
326 await self._registry.register(
327 event_name, # type: ignore[arg-type]
328 config,
329 HookSource.USER_SETTINGS,
330 )
331
332 try:
333 self._last_mtime = self._settings_path.stat().st_mtime
334 except OSError:
335 self._last_mtime = 0.0
336
337 return snapshot
338
339 async def reload_if_changed(self) -> bool:
340 try:

Callers 3

reload_if_changedMethod · 0.95
test_loadMethod · 0.95

Calls 4

load_hooks_from_settingsFunction · 0.85
clear_sourceMethod · 0.80
itemsMethod · 0.80
registerMethod · 0.45

Tested by 2

test_loadMethod · 0.76