summaryrefslogtreecommitdiff
path: root/portato
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
parent3cd0926203e1a6e7c8bd50a8195336c85daf9f25 (diff)
downloadportato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.gz
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.bz2
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.zip
Fixed interactive search with category names
Diffstat (limited to 'portato')
-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)
td>René 'Necoro' Neumann1-0/+9 2013-12-03zsh: Make up-/down- to only use local history and Ctrl-R/-S to use globalRené 'Necoro' Neumann1-1/+13 2013-12-02One more new webfontRené 'Necoro' Neumann1-0/+9 2013-11-21IE: Remove isub/isup: they are not supported anymoreRené 'Necoro' Neumann1-1/+1 2013-11-21IE/IJ: Session logicRené 'Necoro' Neumann1-2/+15 2013-11-06Colorscheme for virtual console.René 'Necoro' Neumann1-1/+5 2013-11-01Do not try to set window title and stuff in linux consoleRené 'Necoro' Neumann1-0/+3 2013-10-30Set terminal title not only on path change, but for each new prompt.René 'Necoro' Neumann1-2/+2 2013-10-22cwd-spawn: Use M-Return instead of M-o for consistency.René 'Necoro' Neumann1-2/+2 2013-10-22Add cwd-spawn to urxvt to allow spawning a new terminal from the currentRené 'Necoro' Neumann3-2/+199 2013-10-22Use chpwd_functions and precmd_functions instead of putting everything inRené 'Necoro' Neumann1-19/+23 2013-09-30urxvt: execute the wgetpaste check each timeRené 'Necoro' Neumann1-2/+5 2013-09-30urxvt: wgetpaste fixRené 'Necoro' Neumann1-4/+4 2013-09-30Allow HOME variable in .Xresources.René 'Necoro' Neumann2-3/+3 2013-09-30wgetpaste support for urxvt.René 'Necoro' Neumann2-1/+28 2013-09-30Urxvt autotransform for <filename>:<line>.René 'Necoro' Neumann1-1/+4 2013-09-30Remove tabbed(x) from urxvt. We use i3 -- no need for it.René 'Necoro' Neumann1-9/+0 2013-09-30Do not display icon in urxvt. It's not supported by i3 anyway.René 'Necoro' Neumann1-1/+1 2013-09-29Remove wrong monitors lineRené 'Necoro' Neumann1-1/+0 2013-09-29Delete vimperator paste plugin -- seems not to work anymore with new FFRené 'Necoro' Neumann1-266/+0 2013-09-29Use $HOST instead of Cauchiy in titleRené 'Necoro' Neumann1-1/+1 2013-09-24Remove herbstluftwmRené 'Necoro' Neumann1-1/+0 2013-09-24Conky changesRené 'Necoro' Neumann2-5/+13 2013-09-15Remove trailing slash from \~ulpRené 'Necoro' Neumann1-1/+1 2013-09-15Make cci explicitly use python2René 'Necoro' Neumann1-1/+1 2013-09-10Node/NPM preparationRené 'Necoro' Neumann3-1/+13