pkgcore.restrictions.restriction module¶
base restriction class
- class pkgcore.restrictions.restriction.AlwaysBool(*a, **kw)[source]¶
Bases:
baserestriction that always yields a specific boolean
- negate¶
- type¶
- class pkgcore.restrictions.restriction.AnyMatch(*a, **kw)[source]¶
Bases:
baseApply a nested restriction to every item in a sequence.
- negate¶
- restriction¶
- type¶
- class pkgcore.restrictions.restriction.FakeType(*a, **kw)[source]¶
Bases:
basewrapper to wrap and fake a node_type
- type¶
- class pkgcore.restrictions.restriction.Negate(*a, **kw)[source]¶
Bases:
basewrap and negate a restriction instance
- type¶
- class pkgcore.restrictions.restriction.base(*a, **kw)[source]¶
Bases:
SlotsPicklingMixinbase restriction matching object.
all derivatives should be __slots__ based (lot of instances may wind up in memory).
- package_matching = False¶
- pkgcore.restrictions.restriction.curry_node_type(cls, node_type, extradoc=None)[source]¶
Helper function for creating restrictions of a certain type.
This uses
partialto pass a node_type to the wrapped class, and extends the docstring.- Parameters:
cls – callable (usually a class) that is wrapped.
node_type – value passed as node_type.
extradoc – addition to the docstring. Defaults to “Automatically set to %s type.” % node_type
- Returns:
a wrapped callable.