[Debtags-commits] [svn] r1863 - python
Enrico Zini
enrico at costa.debian.org
Sun Aug 27 21:00:23 UTC 2006
Author: enrico
Date: Sun Aug 27 21:00:22 2006
New Revision: 1863
Modified:
python/ (props changed)
python/wxssearch
Log:
r3200 at viaza: enrico | 2006-08-27 15:58:05 +0100
limit interesting results to 7
Modified: python/wxssearch
==============================================================================
--- python/wxssearch (original)
+++ python/wxssearch Sun Aug 27 21:00:22 2006
@@ -60,19 +60,13 @@
#print pkg
pkgs.append(pkg)
- print len(pkgs), "pkgs"
-
subcoll = self.fullcoll.choosePackages(pkgs)
- print subcoll.packageCount(), subcoll.tagCount()
-
relIndex = Debtags.relevanceIndexFunction(self.fullcoll, subcoll)
# Get all the tags sorted by increasing relevance
self.interesting = sorted(subcoll.iterTags(), lambda b, a: cmp(relIndex(a), relIndex(b)))
- print "I", len(self.interesting)
-
# Notify the change
e = Model.ModelEvent(Model.wxEVT_CHANGED)
self.ProcessEvent(e)
@@ -86,11 +80,14 @@
self.InsertColumn(0, "Available tags")
def OnGetItemText(self, row, col):
- return self.model.interesting[row]
+ if row < 7:
+ return self.model.interesting[row]
+ else:
+ return None
def modelChanged(self, event):
print "size", len(self.model.interesting)
- self.SetItemCount(len(self.model.interesting))
+ self.SetItemCount(max(7, len(self.model.interesting)))
class SearchWindow(wx.Frame):
More information about the Debtags-commits
mailing list