Return true if `env_var` is set and is not one of: 0, '', no, false
(env_var: str, default: str = "0")
| 150 | |
| 151 | |
| 152 | def env_is_truthy(env_var: str, default: str = "0") -> bool: |
| 153 | """Return true if `env_var` is set and is not one of: 0, '', no, false""" |
| 154 | env = os.getenv(env_var, default) |
| 155 | if env is not None: |
| 156 | return env not in ("", "0", "no", "false") |
| 157 | return False |
| 158 | |
| 159 | |
| 160 | class UIError(Exception): |
no outgoing calls
no test coverage detected