diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-02-15 01:14:40 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-02-15 17:37:46 +0100 |
commit | 69b0eb1dfe63a9d166742a7515d10ca24b71c4a2 (patch) | |
tree | af775856c8b92788146b367eeb14d945e670676d | |
parent | 9e151d663c608ef06a19a8cf82ebdb557fe06d28 (diff) | |
download | jenkins.debian.net-69b0eb1dfe63a9d166742a7515d10ca24b71c4a2.tar.xz |
reproducible: html_indexes: (ugly) support for section where another number is needed
-rwxr-xr-x | bin/reproducible_html_indexes.py | 10 |
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 |