MCPcopy
hub / github.com/mandarons/icloud-docker / traverse_config_path

Function traverse_config_path

src/config_utils.py:24–41  ·  view source on GitHub ↗

Traverse and validate existence of a config path. Recursively checks if a path exists in the configuration dictionary. Does not retrieve values, only validates path existence. Args: config: Configuration dictionary to traverse config_path: List of keys forming the path

(config: dict, config_path: list[str])

Source from the content-addressed store, hash-verified

22
23
24def traverse_config_path(config: dict, config_path: list[str]) -> bool:
25 """Traverse and validate existence of a config path.
26
27 Recursively checks if a path exists in the configuration dictionary.
28 Does not retrieve values, only validates path existence.
29
30 Args:
31 config: Configuration dictionary to traverse
32 config_path: List of keys forming the path to check
33
34 Returns:
35 True if path exists and is valid, False otherwise
36 """
37 if len(config_path) == 0:
38 return True
39 if not (config and config_path[0] in config):
40 return False
41 return traverse_config_path(config[config_path[0]], config_path=config_path[1:])
42
43
44def get_config_value(config: dict, config_path: list[str]) -> Any:

Callers 15

get_usernameFunction · 0.90
get_retry_login_intervalFunction · 0.90
get_regionFunction · 0.90
get_app_max_threadsFunction · 0.90
get_photos_filtersFunction · 0.90
get_sync_summary_enabledFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected