summaryrefslogtreecommitdiff
path: root/portato/db/dict.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-02 12:47:49 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-02 12:47:49 +0100
commita80ff9994c49b3aaba7d3f0bbf6317107fcf39bb (patch)
tree1ebe1c0b4ca15b4826adf8e930f0cd945510c2bb /portato/db/dict.py
parent7d7cccefa1373570791bde516dd90f5055888481 (diff)
downloadportato-a80ff9994c49b3aaba7d3f0bbf6317107fcf39bb.tar.gz
portato-a80ff9994c49b3aaba7d3f0bbf6317107fcf39bb.tar.bz2
portato-a80ff9994c49b3aaba7d3f0bbf6317107fcf39bb.zip
Do not show categories which only hold disabled packages
Diffstat (limited to '')
-rw-r--r--portato/db/dict.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/portato/db/dict.py b/portato/db/dict.py
index fd859dd..d7e2649 100644
--- a/portato/db/dict.py
+++ b/portato/db/dict.py
@@ -62,17 +62,20 @@ class DictDatabase (Database):
self._db[key].sort(key = self.__sort_key)
@lock
- def get_cat (self, cat = None, byName = True):
+ def get_cat (self, cat = None, byName = True, showDisabled = False):
if not cat:
cat = self.ALL
def get_pkgs():
if byName:
for pkg in self._db[cat]:
- yield pkg
+ if showDisabled or not pkg.disabled:
+ yield pkg
else:
ninst = []
for pkg in self._db[cat]:
+ if not showDisabled and pkg.disabled: continue
+
if pkg.inst:
yield pkg
else: