From cc2eb1413036addc474a5300a47a8f580d0a1842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 15 Feb 2018 21:21:43 +0100 Subject: [PATCH] daca2-report: fixes --- tools/daca2-report.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/daca2-report.py b/tools/daca2-report.py index 6ba0e86c2..0fa497e93 100644 --- a/tools/daca2-report.py +++ b/tools/daca2-report.py @@ -32,17 +32,18 @@ def readdate(data): datepos += 1 -def summaryHtml(style, font, text1, text2, text3): +def summaryHtml(style, font, severity, categories, totalNumber): font1 = '' font2 = '' if font: font1 = font font2 = '' - return ' ' + - '' + font1 + text1 + font2 + ' ' + - '' + font1 + text2 + font2 + ' ' + - '' + font1 + text3 + font2 + ' ' + - '\n' + ret = ' ' + ret = ret + '' + font1 + severity + font2 + ' ' + ret = ret + '' + font1 + str(categories) + font2 + ' ' + ret = ret + '' + font1 + str(totalNumber) + font2 + ' ' + ret = ret + '\n' + return ret daca2folder = os.path.expanduser('~/daca2/') path = '' @@ -173,11 +174,11 @@ mainpage.write('\n') mainpage.write('Summary\n') mainpage.write('\n') mainpage.write(summaryHtml('style="background-color:#369"', '', 'Severity', 'Types', 'Amount')) -mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Error (there is bug)', categories['error'], totalNumber['error'])) -mainpage.write(summaryHtml('style="background-color:#ccccff"', None, 'Warning (potential bug)', categories['warning'], totalNumber['warning'])) -mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Style', categories['style'], totalNumber['style'])) -mainpage.write(summaryHtml('style="background-color:#ccccff"', None, 'Portability', categories['portability'], totalNumber['portability'])) -mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Performance', categories['performance'], totalNumber['performance'])) +mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Error (there is bug)', len(categories['error']), totalNumber['error'])) +mainpage.write(summaryHtml('style="background-color:#ccccff"', None, 'Warning (potential bug)', len(categories['warning']), totalNumber['warning'])) +mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Style', len(categories['style']), totalNumber['style'])) +mainpage.write(summaryHtml('style="background-color:#ccccff"', None, 'Portability', len(categories['portability']), totalNumber['portability'])) +mainpage.write(summaryHtml('style="background-color:#fff"', None, 'Performance', len(categories['performance']), totalNumber['performance'])) mainpage.write('
\n') if lastupdate: