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(*a, **kw)[source]

Bases: AnyMatch

force_False(pkg, attr, val)[source]
force_True(pkg, attr, val)[source]
class pkgcore.restrictions.values.ContainmentMatch(*a, **kw)[source]

Bases: 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(*a, **kw)[source]

Bases: base

data
match(actual_val)[source]
negate
class pkgcore.restrictions.values.FlatteningRestriction(*a, **kw)[source]

Bases: base

Flatten the values passed in and apply the nested restriction.

dont_iter
match(val)[source]
negate
restriction
class pkgcore.restrictions.values.FunctionRestriction(*a, **kw)[source]

Bases: base

Convenience class for creating special restrictions.

func
match(val)[source]
negate
class pkgcore.restrictions.values.GetAttrRestriction(*a, **kw)[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 = 'values'
class pkgcore.restrictions.values.StrConversion(*a, **kw)[source]

Bases: base

convert passed in data to a str object

match(val)[source]
restrict
class pkgcore.restrictions.values.StrExactMatch(*a, **kw)[source]

Bases: base

exact string comparison match

case_sensitive
exact
intersect(other)[source]
match(value)[source]
negate
class pkgcore.restrictions.values.StrGlobMatch(*a, **kw)[source]

Bases: base

globbing matches; essentially startswith and endswith matches

flags
glob
match(value)[source]
negate
prefix
class pkgcore.restrictions.values.StrRegex(*a, **kw)[source]

Bases: base

regex based matching

flags
ismatch
match(value)[source]
negate
regex
class pkgcore.restrictions.values.UnicodeConversion(*a, **kw)[source]

Bases: StrConversion

convert passed in data to a unicode obj

match(val)[source]
class pkgcore.restrictions.values.VersionRestriction(*a, **kw)[source]

Bases: base

use this as base for version restrictions.

Gives a clue to what the restriction does.

class pkgcore.restrictions.values.base(*a, **kw)[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 = 'values'
pkgcore.restrictions.values.hashed_base(name, bases, scope)[source]