summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-04-12 22:15:45 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-04-12 22:15:45 +0200
commitcb7b1a3ff6d44ed016e990ee47034a3f004c172c (patch)
tree4e5d04adc74b43d3ecbb8df3a4958a698915f226 /portato
parent668c676ac5acc28559381aae13688798104458b5 (diff)
parent5145d0d3eb7fb8ea47eb8ca7bfae20322c40eabe (diff)
downloadportato-cb7b1a3ff6d44ed016e990ee47034a3f004c172c.tar.gz
portato-cb7b1a3ff6d44ed016e990ee47034a3f004c172c.tar.bz2
portato-cb7b1a3ff6d44ed016e990ee47034a3f004c172c.zip
Merge branch '0.14'
Diffstat (limited to 'portato')
-rw-r--r--portato/db/eix_sql.py2
-rw-r--r--portato/gui/windows/main.py26
2 files changed, 19 insertions, 9 deletions
diff --git a/portato/db/eix_sql.py b/portato/db/eix_sql.py
index 9ba75ff..2a693e9 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)
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index ac1d376..2c6d591 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1125,6 +1125,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...")
@@ -1144,6 +1147,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)
@@ -1171,6 +1177,8 @@ class MainWindow (Window):
if r[col] == sname[0]:
row = r
break
+ else:
+ row = model[0]
else:
row = model[p]
@@ -1181,7 +1189,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)
@@ -1581,11 +1590,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()
@@ -1612,8 +1621,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 ;)
@@ -1624,6 +1633,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("")