Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit aead2df5 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

controllers/segmenter.py: simple HTML formatting

parent d4b0d180
...@@ -23,7 +23,7 @@ def index(): ...@@ -23,7 +23,7 @@ def index():
Field('file', 'upload', uploadfolder=os.path.join(request.folder,'uploads'))) Field('file', 'upload', uploadfolder=os.path.join(request.folder,'uploads')))
form.element('textarea[name=sequences]')['_style'] = 'width:800px; height:200px;' form.element('textarea[name=sequences]')['_style'] = 'width:800px; height:200px;'
text_result = "" t_result = ""
if form.process(onvalidation=checkform_segmenter).accepted: if form.process(onvalidation=checkform_segmenter).accepted:
with TemporaryDirectory() as folder_path: with TemporaryDirectory() as folder_path:
...@@ -57,6 +57,12 @@ def index(): ...@@ -57,6 +57,12 @@ def index():
with open(result_path, 'r') as myfile: with open(result_path, 'r') as myfile:
text_result = myfile.read() text_result = myfile.read()
t_result = ''
for l in text_result.split('\n'):
pre, post = ('<span style="color: #090; font-weight:bold;">', '</span>') if l.startswith('>') else ('', '')
t_result += pre + l + post + '\n'
response.flash = file_path response.flash = file_path
elif form.errors: elif form.errors:
...@@ -64,7 +70,7 @@ def index(): ...@@ -64,7 +70,7 @@ def index():
#form.errors.sequences = form.vars.sequences #form.errors.sequences = form.vars.sequences
return dict(form=form, return dict(form=form,
result=text_result) result=XML(t_result))
......
...@@ -14,7 +14,7 @@ To analyze complete NGS RepSeq datasets, use the <a href="http://app.vidjil.org/ ...@@ -14,7 +14,7 @@ To analyze complete NGS RepSeq datasets, use the <a href="http://app.vidjil.org/
<div> <div>
{{if result != "":}} {{if result != "":}}
<h3>Result</h3> <h3>Result</h3>
<pre class="text invalidinput" cols="40" name="result" rows="10" style="width: 100%; height: 2000px; font-family:monospace">{{=result}} <div class="text invalidinput" cols="40" name="result" rows="10" style="width: 100%; height: 2000px; font-family:monospace; white-space: pre;">{{=result}}
</pre> </div>
{{pass}} {{pass}}
</div> </div>
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