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():
Field('file', 'upload', uploadfolder=os.path.join(request.folder,'uploads')))
form.element('textarea[name=sequences]')['_style'] = 'width:800px; height:200px;'
text_result = ""
t_result = ""
if form.process(onvalidation=checkform_segmenter).accepted:
with TemporaryDirectory() as folder_path:
......@@ -57,6 +57,12 @@ def index():
with open(result_path, 'r') as myfile:
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
elif form.errors:
......@@ -64,7 +70,7 @@ def index():
#form.errors.sequences = form.vars.sequences
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/
<div>
{{if result != "":}}
<h3>Result</h3>
<pre class="text invalidinput" cols="40" name="result" rows="10" style="width: 100%; height: 2000px; font-family:monospace">{{=result}}
</pre>
<div class="text invalidinput" cols="40" name="result" rows="10" style="width: 100%; height: 2000px; font-family:monospace; white-space: pre;">{{=result}}
</div>
{{pass}}
</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