MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _load_config

Method _load_config

core/daemon_config.py:64–75  ·  view source on GitHub ↗

Load configuration from file or return defaults.

(self)

Source from the content-addressed store, hash-verified

62 self._config: Dict[str, Any] = self._load_config()
63
64 def _load_config(self) -> Dict[str, Any]:
65 """Load configuration from file or return defaults."""
66 if self.config_file.exists():
67 try:
68 with open(self.config_file, 'r') as f:
69 user_config = json.load(f)
70 # Merge with defaults
71 return self._merge_configs(DEFAULT_CONFIG, user_config)
72 except (json.JSONDecodeError, IOError) as e:
73 print(f"Warning: Could not load config file: {e}")
74 return DEFAULT_CONFIG.copy()
75 return DEFAULT_CONFIG.copy()
76
77 def _merge_configs(self, base: Dict, override: Dict) -> Dict:
78 """Recursively merge override config into base config."""

Callers 1

__init__Method · 0.95

Calls 3

_merge_configsMethod · 0.95
existsMethod · 0.80
loadMethod · 0.80

Tested by

no test coverage detected