[Secure-testing-commits] r25766 - bin
Luciano Bello
luciano at moszumanska.debian.org
Sun Feb 16 16:40:44 UTC 2014
Author: luciano
Date: 2014-02-16 16:40:44 +0000 (Sun, 16 Feb 2014)
New Revision: 25766
Modified:
bin/tracker_service.py
Log:
Thanks to Antonio Terceiro Closes #727534 , with some small modifications
Modified: bin/tracker_service.py
===================================================================
--- bin/tracker_service.py 2014-02-16 16:14:52 UTC (rev 25765)
+++ bin/tracker_service.py 2014-02-16 16:40:44 UTC (rev 25766)
@@ -98,6 +98,7 @@
td { vertical-align: baseline }
span.red { color: red; }
span.purple { color: purple; }
+span.green { color: green; }
span.dangerous { color: rgb(191,127,0); }
"""), SCRIPT('''var old_query_value = "";
@@ -545,6 +546,34 @@
for (bug, description) in lst:
yield self.make_xref(url, bug), description
+ suites = ()
+ for (releases, version) in self.db.getSourcePackageVersions(
+ self.db.cursor(), pkg):
+ for r in releases:
+ if r not in suites:
+ suites = suites + (r,)
+
+ def gen_summary(bugs):
+ for (bug, description) in bugs:
+ status = {}
+ for (package, releases, version, vulnerable) \
+ in self.db.getSourcePackages(self.db.cursor(), bug):
+ for release in releases:
+ if package == pkg:
+ if vulnerable == 1:
+ status[release] = self.make_red('vulnerable')
+ elif vulnerable == 2:
+ status[release] = self.make_purple('undetermined')
+ else:
+ status[release] = self.make_green('fixed')
+ status_row = ()
+ for release in suites:
+ if release in status:
+ status_row = status_row + (status[release],)
+ else:
+ status_row = status_row + (self.make_purple('unknown'),)
+ yield (self.make_xref(url, bug),) + status_row + (description,)
+
return self.create_page(
url, 'Information on source package ' + pkg,
[make_menu(lambda x: x,
@@ -558,11 +587,17 @@
make_table(gen_versions(), caption=('Release', 'Version')),
H2('Open issues'),
- make_table(gen_bug_list(self.db.getBugsForSourcePackage
- (self.db.cursor(), pkg, True, False)),
- caption=('Bug', 'Description'),
- replacement='No known open issues.'),
+ make_table(
+ gen_summary(
+ # open issues
+ self.db.getBugsForSourcePackage(
+ self.db.cursor(), pkg, True, False),
+ ),
+ caption=('Bug',) + suites + ('Description',),
+ replacement='No known open issues.'
+ ),
+
H2('Open unimportant issues'),
make_table(gen_bug_list(self.db.getBugsForSourcePackage
(self.db.cursor(), pkg, True, True)),
@@ -1326,6 +1361,9 @@
def make_purple(self, contents):
return SPAN(contents, _class="purple")
+ def make_green(self, contents):
+ return SPAN(contents, _class="green")
+
def make_dangerous(self, contents):
return SPAN(contents, _class="dangerous")
More information about the Secure-testing-commits
mailing list