diff options
author | Marius Mauch <genone@gentoo.org> | 2008-09-28 23:38:28 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2008-09-28 23:38:28 +0000 |
commit | 2ca7e5fbf77548de093a48c0f2146a3727007502 (patch) | |
tree | 2722ff5190bcd5a46ac9449a6f9764d112a626e5 | |
parent | 9578cd96d673cca832093b8ae0d06907fbefcf6a (diff) | |
download | portage-2ca7e5fbf77548de093a48c0f2146a3727007502.tar.gz portage-2ca7e5fbf77548de093a48c0f2146a3727007502.tar.bz2 portage-2ca7e5fbf77548de093a48c0f2146a3727007502.zip |
Add a new DummyPackageSet handler to make set operators easier to use
svn path=/main/trunk/; revision=11598
-rw-r--r-- | pym/portage/sets/base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index 4de3e847d..370b03d45 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -219,3 +219,16 @@ class InternalPackageSet(EditablePackageSet): def write(self): pass +class DummyPackageSet(PackageSet): + def __init__(self, atoms=None): + super(DummyPackageSet, self).__init__() + if atoms: + self._setAtoms(atoms) + + def load(self): + pass + + def singleBuilder(cls, options, settings, trees): + atoms = options.get("packages", "").split() + return DummyPackageSet(atoms=atoms) + singleBuilder = classmethod(singleBuilder) |