Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Test as a Service Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INS Courses
AutPy
Test as a Service Client
Commits
47cb77c1
Commit
47cb77c1
authored
3 years ago
by
Urs Baumann
Browse files
Options
Downloads
Plain Diff
Merge branch 'more-output' into 'master'
More output See merge request
!1
parents
d12985f0
c0f08ab4
Branches
Branches containing commit
No related tags found
1 merge request
!1
More output
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
taas_client/cli.py
+10
-1
10 additions, 1 deletion
taas_client/cli.py
with
10 additions
and
1 deletion
taas_client/cli.py
+
10
−
1
View file @
47cb77c1
from
logging
import
error
import
time
import
sys
from
click.termui
import
style
import
typer
...
...
@@ -23,6 +24,11 @@ def upload_file(
),
url
:
str
=
typer
.
Argument
(
"
http://localhost:5000/testbook
"
,
envvar
=
"
TAAS_URL
"
),
):
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
:
with
console
.
status
(
"
[bold green]Testing...
"
):
...
...
@@ -60,9 +66,12 @@ 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
)
raise
typer
.
Exit
(
code
=
1
)
print
(
"
:mailbox: :heavy_check_mark: [bold]Submission successful![/]
"
)
def
run
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment