summaryrefslogtreecommitdiff
path: root/portato/db/dict.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-02 11:29:08 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-02 11:29:08 +0100
commitd97a8bba4c3c877953bc6e800095ac4bc699ea45 (patch)
tree9a0219affdca8fd2f569a6eaa6ea163b6c4ade17 /portato/db/dict.py
parent59792e7297d90cdead2e1c83e4537991b20dd11c (diff)
downloadportato-d97a8bba4c3c877953bc6e800095ac4bc699ea45.tar.gz
portato-d97a8bba4c3c877953bc6e800095ac4bc699ea45.tar.bz2
portato-d97a8bba4c3c877953bc6e800095ac4bc699ea45.zip
Add the disabled field to PkgData
Diffstat (limited to 'portato/db/dict.py')
-rw-r--r--portato/db/dict.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/portato/db/dict.py b/portato/db/dict.py
index d230821..422246f 100644
--- a/portato/db/dict.py
+++ b/portato/db/dict.py
@@ -51,7 +51,7 @@ class DictDatabase (Database):
for p in packages:
cat, pkg = p.split("/")
inst = p in installed
- t = PkgData(cat, pkg, inst)
+ t = PkgData(cat, pkg, inst, False)
self._db[cat].append(t)
self._db[self.ALL].append(t)
@@ -124,6 +124,14 @@ class DictDatabase (Database):
self.__initialize()
self.populate()
+ @lock
+ def disable (self, cpv):
+ cat, pkg = cpv.split("/")
+
+ c = self._db[cat]
+ p = c[c.find(PkgData(cat, pkg))]
+ p.disabled = True
+
def get_restrict (self):
return self._restrict