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

Improve output

parent dc23856f
No related branches found
No related tags found
1 merge request!1More output
......@@ -24,8 +24,10 @@ 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")
modified = round(time.time() - notebook.stat().st_mtime)
sec = 'second' if modified == 1 else 'seconds'
suffix = ', [red]make sure you saved![/]' if modified >= 10 else ''
console.print(f"Last change: [bold]{modified}[/bold] {sec} ago{suffix}")
files = {"file": open(notebook, "rb")}
try:
......@@ -67,7 +69,7 @@ def upload_file(
print(":boom: [bold]Submission failed![/]")
except:
pass
typer.Exit(code=1)
raise typer.Exit(code=1)
print(":mailbox: :heavy_check_mark: [bold]Submission successful![/]")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment