From 69b0eb1dfe63a9d166742a7515d10ca24b71c4a2 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sun, 15 Feb 2015 01:14:40 +0100 Subject: reproducible: html_indexes: (ugly) support for section where another number is needed --- bin/reproducible_html_indexes.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bin/reproducible_html_indexes.py') 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 += '' 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

\n' return html -- cgit v1.2.3-70-g09d2