MCPcopy Create free account
hub / github.com/Accenture/mcp-bench / _set_nested_value

Method _set_nested_value

config/config_loader.py:193–214  ·  view source on GitHub ↗

Set value in nested dictionary using dot-separated path. Args: config: Dictionary to modify path: Dot-separated path (e.g., 'mcp.connection.timeout') value: Value to set at the path

(
        self,
        config: Dict[str, Any],
        path: str,
        value: Any
    )

Source from the content-addressed store, hash-verified

191 return value
192
193 def _set_nested_value(
194 self,
195 config: Dict[str, Any],
196 path: str,
197 value: Any
198 ) -> None:
199 """Set value in nested dictionary using dot-separated path.
200
201 Args:
202 config: Dictionary to modify
203 path: Dot-separated path (e.g., 'mcp.connection.timeout')
204 value: Value to set at the path
205 """
206 keys = path.split('.')
207 current = config
208
209 for key in keys[:-1]:
210 if key not in current:
211 current[key] = {}
212 current = current[key]
213
214 current[keys[-1]] = value
215
216 def get(self, key_path: str, default: Any = None) -> Any:
217 """Get configuration value through dot-separated path.

Callers 1

_apply_env_overridesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected