← Back
Editing: disk_category_config.py
"""Read the opt-in switch without importing the panel web application.""" import os def stats_enabled(config_path): if not os.path.isfile(config_path): return False import public try: config = public.read_config('disk_category_stats') except Exception: return False if not isinstance(config, dict): return False enabled = config.get('enabled', 0) if isinstance(enabled, str): return enabled.strip().lower() not in ('0', 'false', 'off', 'no') return bool(enabled)
Save File
Cancel