Skip to content

Commit

Permalink
🎨 black
Browse files Browse the repository at this point in the history
  • Loading branch information
Wytamma committed May 15, 2024
1 parent 97d2b30 commit 98604af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/beastiary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 98604af

Please sign in to comment.