Commit 69888527 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

segmenter.py: Use os.system instead of Popen

For some reason, Popen complained about a No such file or directory''.
Moreover Popen is not necessary as we don't care about STDOUT or STDERR
parent c722ca67
...@@ -3,7 +3,6 @@ from contextlib import contextmanager ...@@ -3,7 +3,6 @@ from contextlib import contextmanager
import tempfile import tempfile
import shutil import shutil
import defs import defs
from subprocess import Popen, PIPE, STDOUT, os
import gluon import gluon
if request.env.http_origin: if request.env.http_origin:
...@@ -51,7 +50,6 @@ def segment_sequences(sequences): ...@@ -51,7 +50,6 @@ def segment_sequences(sequences):
#store result in a tmp file #store result in a tmp file
result_path = folder_path + "/sequences.vidjil" result_path = folder_path + "/sequences.vidjil"
result = open(result_path, 'w')
## les chemins d'acces a vidjil / aux fichiers de sequences ## les chemins d'acces a vidjil / aux fichiers de sequences
germline_folder = defs.DIR_VIDJIL + '/germline/' germline_folder = defs.DIR_VIDJIL + '/germline/'
...@@ -65,11 +63,8 @@ def segment_sequences(sequences): ...@@ -65,11 +63,8 @@ def segment_sequences(sequences):
cmd += ' ' + config + ' ' + file_path cmd += ' ' + config + ' ' + file_path
## execute la commande vidjil ## execute la commande vidjil
sys.stdout.flush() os.system(cmd)
p = Popen(cmd, shell=True, stdin=PIPE, stdout=result, stderr=STDOUT, close_fds=True)
p.wait()
result.close()
with open(result_path, 'r') as myfile: with open(result_path, 'r') as myfile:
text_result = myfile.read() text_result = myfile.read()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment