From 52c61821a1eca27c4406374174e8836593b68e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 12 Apr 2010 21:53:32 +0200 Subject: Convert the stored mtime to float before using it --- portato/db/eix_sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'portato') diff --git a/portato/db/eix_sql.py b/portato/db/eix_sql.py index 75bcb1e..758f42c 100644 --- a/portato/db/eix_sql.py +++ b/portato/db/eix_sql.py @@ -46,7 +46,7 @@ class EixSQLDatabase (SQLDatabase): def updated (self): mtime = os.stat(self.cache).st_mtime - old = self.session.get("mtime", 0) + old = float(self.session.get("mtime", 0)) self.session["mtime"] = str(mtime) -- cgit v1.2.3 From f458dd4227fce9689a26909e988a7d39d6369206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 12 Apr 2010 22:04:49 +0200 Subject: Fixed jumping and searching. Fixes bug #559480 --- portato/gui/windows/main.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'portato') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 0ec35a2..cad0015 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1124,6 +1124,9 @@ class MainWindow (Window): col = 1 model = self.pkgList.get_model() + if not len(model): # model is no real list, so "not model" won't work + return + if name: if self._jump_check_search(model, pos, lambda r: r[col] != name): debug("Pkg path does not match. Searching...") @@ -1143,6 +1146,9 @@ class MainWindow (Window): col = 0 model = self.catList.get_model() + if not len(model): # model is no real list, so "not model" won't work + return + if name: if self.cfg.get_boolean("collapseCats", "GUI"): sname = name.split("-", 1) @@ -1170,6 +1176,8 @@ class MainWindow (Window): if r[col] == sname[0]: row = r break + else: + row = model[0] else: row = model[p] @@ -1180,7 +1188,8 @@ class MainWindow (Window): pos = ":".join(map(str,path)) break - self.catList.expand_to_path(pos) + if ":" in pos: + self.catList.expand_to_path(pos) debug("Selecting cat path '%s'. Value: '%s'", pos, model[pos][col]) self.catList.get_selection().select_path(pos) @@ -1580,11 +1589,11 @@ class MainWindow (Window): def cb_search_clicked (self, entry): """Do a search.""" text = entry.get_text() - if text != "": - if not "*" in text: - text = ".*%s.*" % text - - packages = system.find_packages(text, with_version = False) + if text: + oldr = self.db.restrict + self.db.restrict = text + packages = list("/".join((p.cat,p.pkg)) for p in self.db.get_cat()) + self.db._restrict = oldr # don't do the rewriting again if packages == []: dialogs.nothing_found_dialog() -- cgit v1.2.3 From 5145d0d3eb7fb8ea47eb8ca7bfae20322c40eabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 12 Apr 2010 22:14:09 +0200 Subject: Redo change, when changing the search type --- portato/gui/windows/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'portato') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index cad0015..bdcb3c6 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -1620,8 +1620,8 @@ class MainWindow (Window): if txt or self.db.restrict: self.db.restrict = txt - self.refresh_stores() - self.catList.get_selection().select_path("0") # XXX make this smarter + self.refresh_stores() + self.catList.get_selection().select_path("0") # XXX make this smarter return False # not again ;) @@ -1632,6 +1632,7 @@ class MainWindow (Window): active = self.typeCombo.get_active() self.db.type = model[active][0] + self.cb_search_changed() def cb_delete_search_clicked (self, *args): self.searchEntry.set_text("") -- cgit v1.2.3