Skip to content
Snippets Groups Projects
Commit 000a6907 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

small bugfix

parent 7be36b3b
No related branches found
No related tags found
1 merge request!269small bugfix
Pipeline #40928 passed
...@@ -708,85 +708,90 @@ def construct_summary(task): ...@@ -708,85 +708,90 @@ def construct_summary(task):
results = "" results = ""
# find the plots in the quality json structure # find the plots in the quality json structure
summary = task.quality_json["summary"] try:
summary = task.quality_json["summary"]
total_size_input = 0 results = "<h4>Summary File (for sas_id " + task.sas_id+ ")</h4> "
total_size_output = 0 #<h4><img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="30" alt="summary">
# Summary File (sas_id {{ task.sas_id }}) </h4>
for key in summary: total_size_input = 0
record = summary[key] total_size_output = 0
for key in summary:
record = summary[key]
total_size_input += record['input_size']
total_size_output+= record['output_size']
line = ''
line += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>' + key + '</b></td></tr>'
line += '<th></th><th>Name</th><th>Size</th>'
line += '<tr><td><b>Input</b></td>'
line += '<td>' + record['input_name'] + '</td>'
line += '<td>' + str(record['input_size']) + ' (' + record['input_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Output</b></td>'
line += '<td>' + record['output_name'] + '</td>'
line += '<td>' + str(record['output_size']) + ' (' + record['output_size_str'] + ')</td>'
line += '</tr>'
line += '<tr><td><b>Ratio</b></td>'
line += '<td>' + str(round(record['size_ratio'],3)) + '</td>'
line += '</tr>'
total_size_input += record['input_size'] try:
total_size_output+= record['output_size'] input_content = record['input_content']
if input_content:
line += '<th>Input Content</th>'
line += '<tr><td colspan="3">'
for filename in input_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
line = '' try:
line += '<tr style="background-color:#7EB1C4"><td colspan="3"><b>' + key + '</b></td></tr>' output_content = record['output_content']
if output_content:
line += '<th>Output Content</th>'
line += '<tr><td colspan="3">'
for filename in output_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
line += '<th></th><th>Name</th><th>Size</th>' try:
line += '<tr><td><b>Input</b></td>' to_add = record['to_add']
line += '<td>' + record['input_name'] + '</td>' if to_add:
line += '<td>' + str(record['input_size']) + ' (' + record['input_size_str'] + ')</td>' line += '<th>to_add</th>'
line += '</tr>' line += '<tr><td colspan="3">'
line += '<tr><td><b>Output</b></td>' for filename in to_add:
line += '<td>' + record['output_name'] + '</td>' line += filename + '\n'
line += '<td>' + str(record['output_size']) + ' (' + record['output_size_str'] + ')</td>' line += '</td></tr>'
line += '</tr>' except:
line += '<tr><td><b>Ratio</b></td>' pass
line += '<td>' + str(round(record['size_ratio'],3)) + '</td>'
line += '</tr>'
try: try:
input_content = record['input_content'] to_delete = record['to_delete']
if input_content: if to_delete:
line += '<th>Input Content</th>' line += '<th>to_delete</th>'
line += '<tr><td colspan="3">' line += '<tr><td colspan="3">'
for filename in input_content: for filename in to_delete:
line += filename + '\n' line += filename + '\n'
line += '</td></tr>' line += '</td></tr>'
except: except:
pass pass
try: results += line
output_content = record['output_content']
if output_content:
line += '<th>Output Content</th>'
line += '<tr><td colspan="3">'
for filename in output_content:
line += filename + '\n'
line += '</td></tr>'
except:
pass
try: try:
to_add = record['to_add'] results += '<th>Totals</th>'
if to_add: results += '<tr><td colspan="1"><b>Input size</b></td><td>' + str(total_size_input) + '</td></tr>'
line += '<th>to_add</th>' results += '<tr><td colspan="1"><b>Output size</b><td>' + str(total_size_output) + '</td></tr>'
line += '<tr><td colspan="3">' results += '<tr><td colspan="1"><b>Ratio</b></td><td>' + str(total_size_output/total_size_output) + '</td></tr>'
for filename in to_add:
line += filename + '\n'
line += '</td></tr>'
except:
pass
try:
to_delete = record['to_delete']
if to_delete:
line += '<th>to_delete</th>'
line += '<tr><td colspan="3">'
for filename in to_delete:
line += filename + '\n'
line += '</td></tr>'
except: except:
pass pass
results += line
try:
results += '<th>Totals</th>'
results += '<tr><td colspan="1"><b>Input size</b></td><td>' + str(total_size_input) + '</td></tr>'
results += '<tr><td colspan="1"><b>Output size</b><td>' + str(total_size_output) + '</td></tr>'
results += '<tr><td colspan="1"><b>Ratio</b></td><td>' + str(total_size_output/total_size_output) + '</td></tr>'
except: except:
pass pass
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<table class="table table-striped"> <table class="table table-striped">
{{ quality | safe }} {{ quality | safe }}
</table> </table>
<h4>Summary File</h4>
<table class="table table-striped"> <table class="table table-striped">
{{ summary | safe }} {{ summary | safe }}
</table> </table>
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<h4><img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="30" alt="summary">
Summary File (sas_id {{ task.sas_id }}) </h4>
<table class="table table-striped"> <table class="table table-striped">
{{ my_summary | safe }} {{ my_summary | safe }}
</table> </table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment