summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-02-15 01:14:40 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-15 17:37:46 +0100
commit69b0eb1dfe63a9d166742a7515d10ca24b71c4a2 (patch)
treeaf775856c8b92788146b367eeb14d945e670676d
parent9e151d663c608ef06a19a8cf82ebdb557fe06d28 (diff)
downloadjenkins.debian.net-69b0eb1dfe63a9d166742a7515d10ca24b71c4a2.tar.xz
reproducible: html_indexes: (ugly) support for section where another number is needed
-rwxr-xr-xbin/reproducible_html_indexes.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index 1e55bdbb..db8baba5 100755
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -132,9 +132,15 @@ def build_leading_text_section(section, rows):
if not no_icon_link:
html += '</a>'
html += '\n' + tab
- try:
+ if section.get('text') and section.get('timely') and section['timely']:
+ count = len(query_db(queries[section['query2']]))
+ percent = round(((count/count_total)*100), 1)
+ html += section['text'].substitute(tot=total, percent=percent,
+ count_total=count_total,
+ count=count)
+ elif section.get('text'):
html += section['text'].substitute(tot=total, percent=percent)
- except KeyError:
+ else:
log.warning('There is no text for this section')
html += '\n</p>\n'
return html