From d97a8bba4c3c877953bc6e800095ac4bc699ea45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 2 Feb 2009 11:29:08 +0100 Subject: Add the disabled field to PkgData --- portato/db/database.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'portato/db/database.py') diff --git a/portato/db/database.py b/portato/db/database.py index 941c3a3..c36c5dc 100644 --- a/portato/db/database.py +++ b/portato/db/database.py @@ -16,15 +16,16 @@ from threading import RLock from functools import wraps class PkgData (object): - __slots__ = ("cat", "pkg", "inst") + __slots__ = ("cat", "pkg", "inst", "disabled") - def __init__ (self, cat, pkg, inst): + def __init__ (self, cat, pkg, inst = False, disabled = False): self.cat = cat self.pkg = pkg self.inst = inst + self.disabled = disabled def __iter__ (self): - return iter((self.cat, self.pkg, self.inst)) + return iter((self.cat, self.pkg, self.inst, self.disabled)) def __cmp__ (self, other): return cmp(self.pkg.lower(), other.pkg.lower()) @@ -80,6 +81,13 @@ class Database (object): """ raise NotImplentedError + def disable (self, cpv): + """Marks the CPV as disabled. + + @param cpv: the cpv to mark + """ + raise NotImplentedError + def reload (self, cat = None): """Reloads the given category. -- cgit v1.2.3