fix: move global declaration to top of main() in api.py
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

This commit is contained in:
2026-03-07 12:18:32 +01:00
parent e723b07fcd
commit c2d5baa34d
2 changed files with 4 additions and 2 deletions

View File

@@ -252,6 +252,8 @@ async def print_image(
def main() -> None:
"""Start the Fichero HTTP API server."""
global _DEFAULT_ADDRESS, _DEFAULT_CLASSIC, _DEFAULT_CHANNEL
try:
import uvicorn # noqa: PLC0415
except ImportError:
@@ -272,7 +274,6 @@ def main() -> None:
args = parser.parse_args()
# Push CLI overrides into module-level defaults so all handlers pick them up
global _DEFAULT_ADDRESS, _DEFAULT_CLASSIC, _DEFAULT_CHANNEL
_DEFAULT_ADDRESS = args.address
_DEFAULT_CLASSIC = args.classic
_DEFAULT_CHANNEL = args.channel