[packagekit] Abstract PackagekitGroups ?
Anders F Björklund
afb at algonet.se
Sun Sep 28 02:35:15 PDT 2008
timlau/hughsie,
Would it be possible to make the yumComps interface
more "generic", like done with the PackagekitFilter ?
I'm thinking something like:
-class yumComps:
+class YumComps(PackagekitGroups):
- def __init__(self, yumbase, db = None):
+ def __init__(self, backend, db=None):
### yumbase = backend.yumbase
- def get_group(self, pkgname):
+ def get_group(self, package):
### pkgname = package.name
Then the same could be used by other backends too,
possibly including the caching (memory or sqlite).
class PackageKitSmartBackend(PackageKitBaseBackend):
def _get_group(self, info, filter_desktops=True):
### info can be gotten from the usual Package class,
### and "filter_desktops" was just an optimization -
### that is not needed if groups are pre-calculated
class PackageKitAptBackend(PackageKitBaseBackend):
def _get_package_group(self, pkg):
--anders
More information about the PackageKit
mailing list