summaryrefslogtreecommitdiff
path: root/patchtracker/Templates.py
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2008-06-26 01:55:58 +0200
committerSean Finney <seanius@debian.org>2008-06-26 01:55:58 +0200
commitbb37cf116269d5948d7f4d592557642696b5d9c7 (patch)
tree279809d4fd86e92043e5f8b70dbf2d502d902678 /patchtracker/Templates.py
parentd08d138655cce56e9e10c4afbc01ccf4eb55a69e (diff)
downloadpatch-tracker-bb37cf116269d5948d7f4d592557642696b5d9c7.tar.gz
package search / versionless implementation
going to /packages/pkg now gives a table of contents with the available versions for the package, or the results of a widers search in the case of no exact matches also removed a bunch of dead code from DB mostly
Diffstat (limited to 'patchtracker/Templates.py')
-rwxr-xr-xpatchtracker/Templates.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/patchtracker/Templates.py b/patchtracker/Templates.py
index ba9764c..0848da1 100755
--- a/patchtracker/Templates.py
+++ b/patchtracker/Templates.py
@@ -44,8 +44,19 @@ class LetterTocTemplate(OurTemplate):
tpl = os.sep.join([Conf.template_dir, "letter_toc.tmpl"])
OurTemplate.__init__(self, file=tpl)
- def releases(self):
- return dists
+class SearchResultsTemplate(OurTemplate):
+ def __init__(self, search, collection):
+ self.pkgs = {}
+ self.idx = search
+ self.dists = {}
+ for idx in collection.indices():
+ for name,packagelist in collection.getletter(idx).iteritems():
+ self.pkgs[name] = packagelist
+ for d in packagelist.iterkeys():
+ self.dists[d] = True
+ tpl = os.sep.join([Conf.template_dir, "searchresults.tmpl"])
+ OurTemplate.__init__(self, file=tpl)
+
class ErrorTemplate(OurTemplate):
def __init__(self, msg):