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
jflow
Commits
deb8268b
Commit
deb8268b
authored
Aug 04, 2014
by
Frédéric Escudié
Browse files
keep updateLight.
parent
e3aee9e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/jflow_server.py
View file @
deb8268b
...
...
@@ -53,8 +53,7 @@ class UploadFieldStorage(cgi.FieldStorage):
return
jflowconf
.
get_tmp_directory
()
def
make_file
(
self
,
binary
=
None
):
jflowconf
=
JFlowConfigReader
()
tmp_folder
=
jflowconf
.
get_tmp_directory
()
tmp_folder
=
self
.
get_tmp_directory
()
if
not
os
.
path
.
exists
(
tmp_folder
):
try
:
os
.
mkdir
(
tmp_folder
)
except
:
pass
...
...
@@ -221,6 +220,28 @@ class JFlowServer (object):
workflow
=
self
.
wfmanager
.
get_workflow
(
kwargs
[
"workflow_id"
])
return
self
.
jsonify_workflow_status
(
workflow
)
@
cherrypy
.
expose
def
uploadLight
(
self
,
**
kwargs
):
prefix
=
""
for
key
in
kwargs
.
keys
():
if
key
==
"prefix"
:
prefix
=
kwargs
[
key
]
else
:
file_param
=
key
# the file transfer can take a long time; by default cherrypy
# limits responses to 300s; we increase it to 1h
cherrypy
.
response
.
timeout
=
3600
# upload file by chunks
FH_sever_file
=
open
(
os
.
path
.
join
(
self
.
jflow_config_reader
.
get_tmp_directory
(),
prefix
+
"_"
+
kwargs
[
file_param
].
filename
.
encode
(
'ascii'
,
'ignore'
)),
"w"
)
while
True
:
data
=
kwargs
[
file_param
].
file
.
read
(
8192
)
if
not
data
:
break
FH_sever_file
.
write
(
data
)
FH_sever_file
.
close
()
@
cherrypy
.
expose
@
cherrypy
.
tools
.
noBodyProcess
()
@
cherrypy
.
tools
.
CORS
()
...
...
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