From abbc143c81d9c5b808d5c8ee14acc33835871fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 28 Jan 2009 12:52:56 +0100 Subject: Moved DictDatabase --- portato/db/database.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'portato/db/database.py') diff --git a/portato/db/database.py b/portato/db/database.py index 7c51667..0ff71a7 100644 --- a/portato/db/database.py +++ b/portato/db/database.py @@ -29,14 +29,42 @@ class PkgData (object): class Database (object): + ALL = _("ALL") + def populate (self, category = None): + """Populates the database. + + @param category: An optional category - so only packages of this category are inserted. + @type category: string + """ raise NotImplentedError def get_cat (self, cat = None, byName = True): + """Returns the packages in the category. + + @param cat: category to return the packages from; if None it defaults to C{ALL} + @type cat: string + @param byName: selects whether to return the list sorted by name or by installation + @type byName: boolean + @return: an iterator over the packages + @rtype: L{PkgData} + """ raise NotImplentedError def get_categories (self, installed = False): + """Returns all categories. + + @param installed: Only return these with at least one installed package. + @type installed: boolean + @returns: the list of categories + @rtype: string + """ raise NotImplentedError def reload (self, cat = None): + """Reloads the given category. + + @param cat: category + @type cat: string + """ raise NotImplentedError -- cgit v1.2.3