Skip to content
Snippets Groups Projects
Commit dc23856f authored by Florian Bruhin's avatar Florian Bruhin
Browse files

Add some output to avoid confusion

parent d12985f0
No related branches found
No related tags found
1 merge request!1More output
from logging import error
import time
import sys
from click.termui import style
import typer
......@@ -23,6 +24,9 @@ def upload_file(
),
url: str = typer.Argument("http://localhost:5000/testbook", envvar="TAAS_URL"),
):
modified = time.time() - notebook.stat().st_mtime
console.print(f"Last change: [bold]{round(modified)}s[/bold] ago")
files = {"file": open(notebook, "rb")}
try:
with console.status("[bold green]Testing..."):
......@@ -60,10 +64,13 @@ def upload_file(
try:
print(f"[red]Error: {exc.response.json().get('error')}[/]", file=sys.stderr)
print(f"[red]Message: {exc.response.json().get('msg')}[/]", file=sys.stderr)
print(":boom: [bold]Submission failed![/]")
except:
pass
typer.Exit(code=1)
print(":mailbox: :heavy_check_mark: [bold]Submission successful![/]")
def run():
typer.run(upload_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment