summaryrefslogtreecommitdiff
path: root/portato/db
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-02 21:49:22 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-02 21:49:22 +0100
commit980f6b90fe2ad4b4ec95d13bb6472bb949b215b1 (patch)
treeba38063a176a97458c1a451153a51242e660e832 /portato/db
parent3cd0926203e1a6e7c8bd50a8195336c85daf9f25 (diff)
downloadportato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.gz
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.bz2
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.zip
Fixed interactive search with category names
Diffstat (limited to 'portato/db')
-rw-r--r--portato/db/dict.py2
-rw-r--r--portato/db/sql.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/portato/db/dict.py b/portato/db/dict.py
index f6edea6..4992df6 100644
--- a/portato/db/dict.py
+++ b/portato/db/dict.py
@@ -86,7 +86,7 @@ class DictDatabase (Database):
try:
if self.restrict:
- return (pkg for pkg in get_pkgs() if self.restrict.search(pkg.pkg))#if pkg[1].find(self.restrict) != -1)
+ return (pkg for pkg in get_pkgs() if self.restrict.search(pkg.cat+"/"+pkg.pkg))
else:
return get_pkgs()
diff --git a/portato/db/sql.py b/portato/db/sql.py
index cb252c1..b794d08 100644
--- a/portato/db/sql.py
+++ b/portato/db/sql.py
@@ -248,6 +248,11 @@ class SQLDatabase (Database):
self._restrict = ""
else:
restrict = restrict.replace(".*","%").replace(".","_")
- self._restrict = "AND name LIKE '%%%s%%'" % restrict
+
+ if "/" in restrict:
+ cat,pkg = restrict.split("/")
+ self._restrict = "AND name LIKE '%%%s%%' AND cat LIKE '%s'" % (pkg, cat)
+ else:
+ self._restrict = "AND (name LIKE '%%%(restrict)s%%' OR cat LIKE '%(restrict)s%%')" % {"restrict":restrict}
restrict = property(get_restrict, set_restrict)
-09-03And here is the debugging again :) ... using ctypesRené 'Necoro' Neumann1-1/+8 2009-09-03Screw debugging ... prefer the ctypes approach to get rid of yet another c-mo...René 'Necoro' Neumann3-27/+11 2009-09-03Use this wrapper instead of ctypes to set the textdomain and stuff for the gt...René 'Necoro' Neumann1-9/+5 2009-09-03Add small wrapper to C-gettextRené 'Necoro' Neumann2-1/+22 2009-08-31Update messages.potRené 'Necoro' Neumann1-42/+94 2009-08-31Removed the gtk- strings from translationsRené 'Necoro' Neumann7-3639/+3479 2009-08-31Removed the 'translatable' attribute from 'gtk-*' stringsRené 'Necoro' Neumann5-11/+11 2009-08-31Removed TODO. Renamed ChangeLog to TODORené 'Necoro' Neumann2-40/+0 2009-08-27Only import stuff if necessaryRené 'Necoro' Neumann1-8/+8 2009-08-25Release the threadQueue-Lock in syncv0.13René 'Necoro' Neumann1-0/+1 2009-08-25Updated portugese translationAlberto Federman Neto1-650/+687 2009-08-15Update spanish translationDaniel Halens1-245/+258 2009-08-15Use boolean flags instead of obscure C flags for ipc.MessageQueueRené 'Necoro' Neumann3-13/+15 2009-08-15TypoRené 'Necoro' Neumann1-1/+1 2009-08-15Enhanced the extensions.shRené 'Necoro' Neumann1-3/+8 2009-08-15Move eix-format to correct locationRené 'Necoro' Neumann1-0/+0