Author: fw
Date: 2010-03-07 17:44:14 +0000 (Sun, 07 Mar 2010)
New Revision: 14207
Modified:
bin/tracker_service.py
Log:
bin/tracker_service.py: Remove binary package data from webpage
This is just to see if it is feasible to remove all binary package
processing. Some people might use tracker as some sort of "dak ls"
replacement.
Modified: bin/tracker_service.py
==================================================================---
bin/tracker_service.py 2010-03-07 16:40:56 UTC (rev 14206)
+++ bin/tracker_service.py 2010-03-07 17:44:14 UTC (rev 14207)
@@ -132,7 +132,6 @@
self.register(''*'', self.page_object)
self.register(''redirect/*'', self.page_redirect)
self.register(''source-package/*'',
self.page_source_package)
- self.register(''binary-package/*'',
self.page_binary_package)
self.register(''status/release/oldstable'',
self.page_status_release_oldstable)
self.register(''status/release/stable'',
self.page_status_release_stable)
@@ -278,8 +277,6 @@
if self.db.isSourcePackage(c, obj):
return RedirectResult(self.url_source_package(url, obj, full=True))
- if self.db.isBinaryPackage(c, obj):
- return RedirectResult(self.url_binary_package(url ,obj, full=True))
return self.page_not_found(url, obj)
@@ -394,35 +391,6 @@
caption=("Source Package", "Release",
"Version", "Status"),
introduction=P(''The table below lists information on source
packages.'')))
- def gen_binary():
- old_pkg = ''''
- for (packages, releases, version, archs, vulnerable) \
- in self.db.getBinaryPackages(cursor, bug.name):
- pkg = '', ''.join(packages)
- if pkg == old_pkg:
- packages = ''''
- else:
- old_pkg = pkg
- packages = self.make_binary_packages_ref(url, packages)
-
- if vulnerable == 1:
- vuln = self.make_red(''vulnerable'')
- version = self.make_red(version)
- elif vulnerable == 2:
- vuln =
self.make_purple(''undetermined'')
- version = self.make_purple(version)
- else:
- vuln = ''fixed''
- yield (packages,
- '', ''.join(releases),
- version, vuln,
- '', ''.join(archs))
-
- page.append(make_table(gen_binary(),
- caption=("Binary Package", "Release",
"Version", "Status",
- "Architecures"),
- introduction=P("The next table lists affected binary
packages.")))
-
def gen_data():
notes_sorted = bug.notes[:]
notes_sorted.sort(lambda a, b: cmp(a.package, b.package))
@@ -446,8 +414,6 @@
pkg_kind = n.package_kind
if pkg_kind == ''source'':
pkg = self.make_source_package_ref(url, pkg)
- elif pkg_kind == ''binary'':
- pkg = self.make_binary_package_ref(url, pkg)
elif pkg_kind == ''itp'':
pkg_kind = ''ITP''
rel = ''''
@@ -563,12 +529,6 @@
for (releases, version) in self.db.getSourcePackageVersions(
self.db.cursor(), pkg):
yield '', ''.join(releases), version
- def gen_binary():
- for (packages, releases, archs, version) \
- in self.db.getBinaryPackagesForSource(
- self.db.cursor(), pkg):
- yield (self.make_binary_packages_ref(url, packages),
- '', ''.join(releases), version,
'', ''.join(archs))
def gen_bug_list(lst):
for (bug, description) in lst:
yield self.make_xref(url, bug), description
@@ -585,13 +545,6 @@
H2("Available versions"),
make_table(gen_versions(), caption=("Release",
"Version")),
- H2("Available binary packages"),
- make_table(gen_binary(),
- caption=(''Package'', ''Release'',
''Version'', ''Architectures''),
- replacement="""No binary packages are recorded in
this database.
-This probably means that the package is architecture-specific, and the
-architecture is currently not tracked."""),
-
H2("Open issues"),
make_table(gen_bug_list(self.db.getBugsForSourcePackage
(self.db.cursor(), pkg, True)),
@@ -604,47 +557,6 @@
caption=(''Bug'',
''Description''),
replacement=''No known resolved
issues.'')])
- def page_binary_package(self, path, params, url):
- pkg = path[0]
-
- def gen_versions():
- for (releases, source, version, archs) \
- in self.db.getBinaryPackageVersions(self.db.cursor(), pkg):
- yield ('', ''.join(releases),
- self.make_source_package_ref(url, source),
- version, '', ''.join(archs))
- def gen_bug_list(lst):
- for (bug, description) in lst:
- yield self.make_xref(url, bug), description
-
- return self.create_page(
- url, "Information on binary package " + pkg,
- [make_menu(lambda x: x,
- (self.url_debian_bug_pkg(url, pkg),
- pkg + '' in the Bug Tracking
System'')),
- H2("Available versions"),
- make_table(gen_versions(),
- caption=("Release", "Source",
"Version", "Architectures")),
-
- H2("Open issues"),
- make_table(gen_bug_list(self.db.getBugsForBinaryPackage
- (self.db.cursor(), pkg, True)),
- caption=(''Bug'',
''Description''),
- replacement=''No known open issues.''),
-
- H2("Resolved issues"),
- make_table(gen_bug_list(self.db.getBugsForBinaryPackage
- (self.db.cursor(), pkg, False)),
- caption=(''Bug'',
''Description''),
- replacement=''No known resolved
issues.''),
-
- H2("Non-issues"),
- make_table(gen_bug_list(self.db.getNonBugsForBinaryPackage
- (self.db.cursor(), pkg)),
- caption=(''Bug'',
''Description''),
- replacement="""No known issues which do not
affect
-this package, but still reference it.""")])
-
def page_status_release_stable_oldstable(self, release, params, url):
assert release in (''stable'',
''oldstable'')
@@ -1300,11 +1212,6 @@
return url.scriptRelativeFull("source-package/" +
package)
else:
return url.scriptRelative("source-package/" + package)
- def url_binary_package(self, url, package, full=False):
- if full:
- return url.scriptRelativeFull("binary-package/" +
package)
- else:
- return url.scriptRelative("binary-package/" + package)
def make_xref(self, url, name):
return A(url.scriptRelative(name), name)
@@ -1350,14 +1257,6 @@
if title is None:
title = pkg
return A(self.url_source_package(url, pkg), title)
- def make_binary_package_ref(self, url, pkg, title=None):
- if title is None:
- title = pkg
- return A(self.url_binary_package(url, pkg), title)
- def make_binary_packages_ref(self, url, lst):
- assert type(lst) <> types.StringType
- return make_list(map(lambda x: self.make_binary_package_ref(url, x),
- lst))
def make_red(self, contents):
return SPAN(contents, _class="red")