From 98604affdf119e9c2dd16b99e00445504eeb9323 Mon Sep 17 00:00:00 2001 From: Wytamma Wirth Date: Wed, 15 May 2024 18:29:41 +1000 Subject: [PATCH] :art: black --- backend/beastiary/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/beastiary/cli.py b/backend/beastiary/cli.py index bb1230a..c3f4795 100644 --- a/backend/beastiary/cli.py +++ b/backend/beastiary/cli.py @@ -14,12 +14,14 @@ app = typer.Typer() + def address_is_available(host: str, port: str) -> bool: import socket with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: return s.connect_ex((host, int(port))) != 0 + @app.command(context_settings={"help_option_names": ["-h", "--help"]}) def main( log_files: Optional[List[Path]] = typer.Argument( @@ -96,7 +98,9 @@ def main( typer.echo("Creating public shareable link...") with cloudflared(port=port) as cloudflared_url: url_with_token = typer.style( - f"{cloudflared_url}/login?token={token}", fg=typer.colors.GREEN, bold=False + f"{cloudflared_url}/login?token={token}", + fg=typer.colors.GREEN, + bold=False, ) typer.echo(f"\nBeastiary is now publicly accessible at: {url_with_token}") uvicorn.run(api, host=host, port=port, log_level=log_level)