pkgcore.repository.virtual module

virtual repository, pkgs generated via callable

class pkgcore.repository.virtual.RestrictionRepo(repo_id, restrictions=(), frozen=False, livefs=False)[source]

Bases: tree

Fake repo populated by packages matching a given restriction.

itermatch(restrict, sorter=<built-in function iter>, pkg_cls=<class 'pkgcore.repository.virtual.InjectedPkg'>)[source]

Generator that yields packages match a restriction.

Parameters:
  • restrict (pkgcore.restrictions.packages.PackageRestriction instance.) – restriction to search via

  • sorter – callable to do sorting during searching- if sorting the results, use this instead of sorting externally.

  • pkg_filter – callable to do package filtering

  • versioned – boolean controlling returning versioned or unversioned pkgs

  • raw_pkg_cls – custom package class to use for generating raw pkg instances

  • pkg_cls – custom package class to override raw pkg instances with

  • yield_none – if True then itermatch will yield None for every non-matching package. This is meant for use in combination with C{twisted.task.cooperate} or other async uses where itermatch should not wait many (wallclock) seconds between yielding packages. If you override this method you should yield None in long-running loops, strictly calling it for every package is not necessary.

match(restrict, **kwargs)[source]
property restriction
class pkgcore.repository.virtual.tree(livefs=False, frozen=False)[source]

Bases: tree

factory_kls

alias of factory