Package portage :: Package dep :: Class Atom
[hide private]

Class Atom

source code

object --+        
         |        
basestring --+    
             |    
       unicode --+
                 |
                Atom

For compatibility with existing atom string manipulation code, this class emulates most of the str methods that are useful with atoms.

Nested Classes [hide private]
  _blocker
Instance Methods [hide private]
 
__init__(self, s, unevaluated_atom=None, allow_wildcard=False, allow_repo=None, _use=None, eapi=None, is_valid_flag=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
with_repo(self, repo) source code
 
with_slot(self, slot) source code
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code
Boolean
intersects(self, other)
Atoms with different cpv, operator or use attributes cause this method to return False even though there may actually be some intersection.
source code
Atom
evaluate_conditionals(self, use)
Create an atom instance with any USE conditionals evaluated.
source code
Atom
violated_conditionals(self, other_use, is_valid_flag, parent_use=None)
Create an atom instance with any USE conditional removed, that is satisfied by other_use.
source code
 
_eval_qa_conditionals(self, use_mask, use_force) source code
 
__copy__(self)
Immutable, so returns self.
source code
 
__deepcopy__(self, memo=None)
Immutable, so returns self.
source code

Inherited from unicode: __add__, __contains__, __eq__, __format__, __ge__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __le__, __len__, __lt__, __mod__, __mul__, __ne__, __repr__, __rmod__, __rmul__, __sizeof__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, format, index, isalnum, isalpha, isdecimal, isdigit, islower, isnumeric, isspace, istitle, isupper, join, ljust, lower, lstrip, partition, replace, rfind, rindex, rjust, rpartition, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

Inherited from unicode (private): _formatter_field_name_split, _formatter_parser

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, s, unevaluated_atom=None, allow_wildcard=False, allow_repo=None, _use=None, eapi=None, is_valid_flag=None) source code
Properties [hide private]
  slot_operator_built
Returns True if slot_operator == "=" and sub_slot is not None.
  without_repo
  without_slot

Inherited from object: __class__

Method Details [hide private]

__new__(cls, s, unevaluated_atom=None, allow_wildcard=False, allow_repo=None, _use=None, eapi=None, is_valid_flag=None)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__init__(self, s, unevaluated_atom=None, allow_wildcard=False, allow_repo=None, _use=None, eapi=None, is_valid_flag=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__setattr__(self, name, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

intersects(self, other)

source code 

Atoms with different cpv, operator or use attributes cause this method to return False even though there may actually be some intersection. TODO: Detect more forms of intersection.

Parameters:
  • other (Atom) - The package atom to match
Returns: Boolean
True if this atom and the other atom intersect, False otherwise.

evaluate_conditionals(self, use)

source code 

Create an atom instance with any USE conditionals evaluated.

Parameters:
  • use (set) - The set of enabled USE flags
Returns: Atom
an atom instance with any USE conditionals evaluated

violated_conditionals(self, other_use, is_valid_flag, parent_use=None)

source code 

Create an atom instance with any USE conditional removed, that is satisfied by other_use.

Parameters:
  • other_use (set) - The set of enabled USE flags
  • is_valid_flag (function) - Function that decides if a use flag is referenceable in use deps
  • parent_use (set) - Set of enabled use flags of the package requiring this atom
Returns: Atom
an atom instance with any satisfied USE conditionals removed

Property Details [hide private]

slot_operator_built


Returns True if slot_operator == "=" and sub_slot is not None.
NOTE: foo/bar:2= is unbuilt and returns False, whereas foo/bar:2/2=
        is built and returns True.

Get Method:
unreachable.slot_operator_built(self) - Returns True if slot_operator == "=" and sub_slot is not None.

without_repo

Get Method:
unreachable.without_repo(self)

without_slot

Get Method:
unreachable.without_slot(self)