Skip to content

Commit

Permalink
🎨 black
Browse files Browse the repository at this point in the history
  • Loading branch information
Wytamma committed Mar 1, 2024
1 parent 056e14b commit 06e67eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion backend/beastiary/api/endpoints/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def create_trace(
try:
# check if trace is outside of the current working directory
if not os.path.abspath(trace_in.path).startswith(os.getcwd()):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), trace_in.path)
raise FileNotFoundError(
errno.ENOENT, os.strerror(errno.ENOENT), trace_in.path
)
trace = add_trace(request.app.db, trace_in)
except FileNotFoundError:
raise HTTPException(404, detail="Could not find log file!")
Expand Down
16 changes: 12 additions & 4 deletions backend/beastiary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ def main(
token: str = typer.Option(str(uuid.uuid4()), "--token", "-t"),
host: str = typer.Option("127.0.0.1", "--host"),
port: str = typer.Option(5000, "--port"),
share: bool = typer.Option(False, "--share", help="Create a publicly shareable link."),
no_security: bool = typer.Option(False, "--no-security", help="Turn off token requirement."),
delimiter: str = typer.Option("\t", "--delimiter", help="Delimiter to split file columns on. Default is tab."),
share: bool = typer.Option(
False, "--share", help="Create a publicly shareable link."
),
no_security: bool = typer.Option(
False, "--no-security", help="Turn off token requirement."
),
delimiter: str = typer.Option(
"\t", "--delimiter", help="Delimiter to split file columns on. Default is tab."
),
debug: bool = typer.Option(False, "--debug", help="Set debug mode."),
testing: bool = typer.Option(False, help="Only for testing.", hidden=True),
) -> None:
Expand Down Expand Up @@ -78,7 +84,9 @@ def main(
if share:
typer.echo("Creating public shareable link...")
with cloudflared(port=port) as cloudflared_url:
url_with_token = typer.style(f"{cloudflared_url}", fg=typer.colors.GREEN, bold=False)
url_with_token = typer.style(
f"{cloudflared_url}", 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)
else:
Expand Down

0 comments on commit 06e67eb

Please sign in to comment.