| 244 | |
| 245 | |
| 246 | def env_config_value(*names: str, default: str = "") -> str: |
| 247 | for name in names: |
| 248 | value = os.environ.get(name, "").strip() |
| 249 | if value: |
| 250 | return value |
| 251 | disable_shell_fallback = os.environ.get("DEEPPAPERNOTE_DISABLE_SHELL_CONFIG", "").strip().lower() |
| 252 | if disable_shell_fallback in {"1", "true", "yes", "on"}: |
| 253 | return default |
| 254 | for name in names: |
| 255 | value = shell_config_value(name) |
| 256 | if value: |
| 257 | return value |
| 258 | return default |
| 259 | |
| 260 | |
| 261 | def title_similarity(a: str, b: str) -> float: |