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

force_False(pkg, attr, val)[source]
force_True(pkg, attr, val)[source]
class pkgcore.restrictions.values.ContainmentMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: _HashedGenericEquality, base

Used 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
force_False(pkg, attr, val, _values_override=None)[source]
force_True(pkg, attr, val, _values_override=None)[source]
match(val, _values_override=None)[source]
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
match(actual_val)[source]
negate
class pkgcore.restrictions.values.FlatteningRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: GenericEquality, base

Flatten the values passed in and apply the nested restriction.

dont_iter
match(val)[source]
negate
restriction
class pkgcore.restrictions.values.FunctionRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: GenericEquality, base

Convenience class for creating special restrictions.

func
match(val)[source]
negate
class pkgcore.restrictions.values.GetAttrRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: PackageRestriction

Restriction pulling an attribute and applying a child restriction.

force_False(pkg, attr, val)[source]
force_True(pkg, attr, val)[source]
type: T_restriction = 'values'
class pkgcore.restrictions.values.StrConversion(restrict)[source]

Bases: GenericEquality

convert passed in data to a str object

match(val)[source]
restrict
class pkgcore.restrictions.values.StrExactMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: _HashedGenericEquality, base

exact string comparison match

case_sensitive
exact
intersect(other)[source]
match(value)[source]
negate
class pkgcore.restrictions.values.StrGlobMatch(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: _HashedGenericEquality, base

globbing matches; essentially startswith and endswith matches

flags
glob
match(value)[source]
negate
prefix
class pkgcore.restrictions.values.StrRegex(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: _HashedGenericEquality, base

regex based matching

match(value)[source]
class pkgcore.restrictions.values.UnicodeConversion(restrict)[source]

Bases: StrConversion

convert passed in data to a unicode obj

match(val)[source]
class pkgcore.restrictions.values.VersionRestriction(*args: Hashable, disable_inst_caching=False, **kwargs: Hashable)[source]

Bases: base

use 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: base

Base restriction matching object for values.

Beware: do not check for instances of this to detect value restrictions! Use the C{type} attribute instead.

force_False(pkg, attr, val)[source]
force_True(pkg, attr, val)[source]
type: T_restriction = 'values'