Skip to content
GitLab
Menu
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
a8a5e45c
Commit
a8a5e45c
authored
Jul 17, 2018
by
Floreal Cabanettes
Browse files
Prevent crash if same file is given as query and target (upload mode)
parent
0e236994
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dgenies/lib/job_manager.py
View file @
a8a5e45c
...
...
@@ -622,7 +622,17 @@ class JobManager:
if
fasta
.
is_example
():
shutil
.
copy
(
fasta
.
get_path
(),
finale_path
)
else
:
shutil
.
move
(
fasta
.
get_path
(),
finale_path
)
if
os
.
path
.
exists
(
fasta
.
get_path
()):
shutil
.
move
(
fasta
.
get_path
(),
finale_path
)
else
:
other_file
=
os
.
path
.
join
(
self
.
output_dir
,
(
"query"
if
type_f
==
"target"
else
"query"
)
+
"_"
+
os
.
path
.
basename
(
fasta
.
get_path
()))
if
os
.
path
.
exists
(
other_file
):
shutil
.
copy
(
other_file
,
finale_path
)
else
:
raise
Exception
(
"Unable to copy %s file from temp to finale path: %s file does not exists"
%
(
type_f
,
fasta
.
get_path
()))
with
open
(
os
.
path
.
join
(
self
.
output_dir
,
"."
+
type_f
),
"w"
)
as
save_file
:
save_file
.
write
(
finale_path
)
return
finale_path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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