Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
1ca0d04e
Commit
1ca0d04e
authored
Dec 18, 2017
by
Floreal Cabanettes
Browse files
Add json format for status
parent
6c20308f
Changes
1
Hide whitespace changes
Inline
Side-by-side
srv/main.py
View file @
1ca0d04e
...
...
@@ -151,6 +151,15 @@ def status(id_job):
minutes
=
time_e
//
60
seconds
=
time_e
-
minutes
*
60
time_e
=
"%d min %d secs"
%
(
minutes
,
seconds
)
format
=
request
.
args
.
get
(
"format"
)
if
format
is
not
None
and
format
==
"json"
:
return
jsonify
({
"status"
:
j_status
[
"status"
],
"error"
:
j_status
[
"error"
].
replace
(
"#ID#"
,
""
),
"id_job"
:
id_job
,
"mem_peak"
:
mem_peak
,
"time_elapsed"
:
time_e
})
return
render_template
(
"status.html"
,
title
=
app_title
,
status
=
j_status
[
"status"
],
error
=
j_status
[
"error"
].
replace
(
"#ID#"
,
""
),
id_job
=
id_job
,
menu
=
"results"
,
mem_peak
=
mem_peak
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment