summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-18 10:58:54 +0100
committerMattia Rizzolo <mattia@mapreri.org>2015-01-19 18:07:31 +0100
commitde644c6630470d3cda91feb365a88668ad4e0192 (patch)
treef89b165f208ec2c86a24faf53e22d9cab17315f8 /bin
parentc2d1495ffd59dc03a64e84cff66e7d7856dd6459 (diff)
downloadjenkins.debian.net-de644c6630470d3cda91feb365a88668ad4e0192.tar.xz
reproducible: _html_notes: allow issues with 0 affected packages
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_html_notes.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 3c5f1356..48310da8 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -290,18 +290,27 @@ def iterate_over_issues(issues):
log.info("you can now see the issue at " + desturl)
i = i + 1
+def sort_issues(issue):
+ try:
+ return (-len(issues_count[issue]), issue)
+ except KeyError: # there are no packages affected by this issue
+ return (0, issue)
+
def index_issues(issues):
templ = "\n<table class=\"body\">\n" + tab + "<tr>\n" + tab*2 + "<th>\n" \
+ tab*3 + "Identified issues\n" + tab*2 + "</th>\n" + tab*2 + "<th>\n" \
+ tab*3 + "Affected packages\n" + tab*2 + "</th>\n" + tab + "</tr>\n"
html = (tab*2).join(templ.splitlines(True))
- for issue in sorted(issues, key=lambda x: (-len(issues_count[x]), x)):
+ for issue in sorted(issues, key=sort_issues):
html += tab*3 + '<tr>\n'
html += tab*4 + '<td><a href="' + ISSUES_URI + '/' + issue + \
'_issue.html">' + issue + '</a></td>\n'
html += tab*4 + '<td>\n'
- html += tab*5 + '<b>' + str(len(issues_count[issue])) + '</b>:\n'
- html += tab*5 + ', '.join(issues_count[issue]) + '\n'
+ try:
+ html += tab*5 + '<b>' + str(len(issues_count[issue])) + '</b>:\n'
+ html += tab*5 + ', '.join(issues_count[issue]) + '\n'
+ except KeyError: # there are no packages affected by this issue
+ html += tab*5 + '<b>0</b>\n'
html += tab*4 + '</td>\n'
html += tab*3 + '</tr>\n'
html += tab*2 + '</table>\n'