diff --git a/fichero/api.py b/fichero/api.py index bc0f9ce..f916e2b 100644 --- a/fichero/api.py +++ b/fichero/api.py @@ -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 diff --git a/fichero_printer/fichero/api.py b/fichero_printer/fichero/api.py index bc0f9ce..f916e2b 100644 --- a/fichero_printer/fichero/api.py +++ b/fichero_printer/fichero/api.py @@ -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