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

segmenter.py: On Vidjil error, result file won't be generated

parent 69888527
......@@ -65,8 +65,11 @@ def segment_sequences(sequences):
## execute la commande vidjil
os.system(cmd)
if os.path.isfile(result_path):
with open(result_path, 'r') as myfile:
text_result = myfile.read()
else:
return response.json({'error': 'Error while processing the file'})
return response.json(gluon.contrib.simplejson.loads(text_result))
......
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