pkgcore.restrictions.values module¶
value restrictions
Works hand in hand with pkgcore.restrictions.packages, these
classes match against a value handed in, package restrictions pull the
attr from a package instance and hand it to their wrapped restriction
(which is a value restriction).
- class pkgcore.restrictions.values.AnyMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
AnyMatch
- class pkgcore.restrictions.values.ContainmentMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
_HashedGenericEquality,baseUsed for an ‘in’ style operation.
For example, ‘x86’ in [‘x86’, ‘~x86’]. Note that negation of this does not result in a true NAND when all is on.
- all¶
- negate¶
- vals¶
- pkgcore.restrictions.values.ContainmentMatch2¶
alias of
ContainmentMatch
- class pkgcore.restrictions.values.EqualityMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
base- data¶
- negate¶
- class pkgcore.restrictions.values.FlatteningRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
GenericEquality,baseFlatten the values passed in and apply the nested restriction.
- dont_iter¶
- negate¶
- restriction¶
- class pkgcore.restrictions.values.FunctionRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
GenericEquality,baseConvenience class for creating special restrictions.
- func¶
- negate¶
- class pkgcore.restrictions.values.GetAttrRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
PackageRestrictionRestriction pulling an attribute and applying a child restriction.
- type: T_restriction = 'values'¶
- class pkgcore.restrictions.values.StrConversion(restrict)[source]¶
Bases:
GenericEqualityconvert passed in data to a str object
- restrict¶
- class pkgcore.restrictions.values.StrExactMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
_HashedGenericEquality,baseexact string comparison match
- case_sensitive¶
- exact¶
- negate¶
- class pkgcore.restrictions.values.StrGlobMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
_HashedGenericEquality,baseglobbing matches; essentially startswith and endswith matches
- flags¶
- glob¶
- negate¶
- prefix¶
- class pkgcore.restrictions.values.StrRegex(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
_HashedGenericEquality,baseregex based matching
- class pkgcore.restrictions.values.UnicodeConversion(restrict)[source]¶
Bases:
StrConversionconvert passed in data to a unicode obj
- class pkgcore.restrictions.values.VersionRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
baseuse this as base for version restrictions.
Gives a clue to what the restriction does.
- class pkgcore.restrictions.values.base(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]¶
Bases:
baseBase restriction matching object for values.
Beware: do not check for instances of this to detect value restrictions! Use the C{type} attribute instead.
- type: T_restriction = 'values'¶