From d97a8bba4c3c877953bc6e800095ac4bc699ea45 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 2 Feb 2009 11:29:08 +0100 Subject: Add the disabled field to PkgData --- portato/db/dict.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'portato/db/dict.py') 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 -- cgit v1.2.3-54-g00ecf