MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _parse_bool

Function _parse_bool

apps/plugins/api_views.py:63–74  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

61
62
63def _parse_bool(value):
64 if isinstance(value, bool):
65 return value
66 if isinstance(value, int) and value in (0, 1):
67 return bool(value)
68 if isinstance(value, str):
69 normalized = value.strip().lower()
70 if normalized in ("true", "1", "yes", "y", "on"):
71 return True
72 if normalized in ("false", "0", "no", "n", "off"):
73 return False
74 return None
75
76
77def _sanitize_plugin_key(value: str) -> str:

Callers 1

postMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected