Get a configuration value by key path. Args: key_path: Dot-separated path to the configuration value default: Default value if key doesn't exist Returns: Configuration value or default
(key_path: str, default: Any = None)
| 233 | |
| 234 | |
| 235 | def get_config_value(key_path: str, default: Any = None) -> Any: |
| 236 | """ |
| 237 | Get a configuration value by key path. |
| 238 | |
| 239 | Args: |
| 240 | key_path: Dot-separated path to the configuration value |
| 241 | default: Default value if key doesn't exist |
| 242 | |
| 243 | Returns: |
| 244 | Configuration value or default |
| 245 | """ |
| 246 | config = get_config() |
| 247 | keys = key_path.split('.') |
| 248 | |
| 249 | # Navigate through the nested dictionaries |
| 250 | current = config |
| 251 | for key in keys: |
| 252 | if not isinstance(current, dict) or key not in current: |
| 253 | return default |
| 254 | current = current[key] |
| 255 | |
| 256 | return current |
| 257 | |
| 258 | |
| 259 | def set_config_value(key_path: str, value: Any) -> None: |
nothing calls this directly
no test coverage detected