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

Function get_usage_tracking_enabled

src/config_parser.py:312–334  ·  view source on GitHub ↗

Get usage tracking enabled setting from configuration. Args: config: Configuration dictionary Returns: True if usage tracking is enabled (default), False if disabled

(config: dict)

Source from the content-addressed store, hash-verified

310
311
312def get_usage_tracking_enabled(config: dict) -> bool:
313 """Get usage tracking enabled setting from configuration.
314
315 Args:
316 config: Configuration dictionary
317
318 Returns:
319 True if usage tracking is enabled (default), False if disabled
320 """
321 config_path = ["app", "usage_tracking", "enabled"]
322 if not traverse_config_path(config=config, config_path=config_path):
323 return True # Default to enabled if not configured
324
325 value = get_config_value(config=config, config_path=config_path)
326 if isinstance(value, bool):
327 return value
328
329 # Handle string values for backwards compatibility
330 if isinstance(value, str):
331 return value.lower() not in ("false", "no", "0", "disabled", "off")
332
333 # Default to enabled for any other type
334 return True
335
336
337# =============================================================================

Callers 1

aliveFunction · 0.90

Calls 2

traverse_config_pathFunction · 0.90
get_config_valueFunction · 0.90

Tested by

no test coverage detected