Package portage :: Package dbapi :: Class dbapi
[hide private]

Class dbapi

source code

object --+
         |
        dbapi
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
close_caches(self) source code
 
cp_list(self, cp, use_cache=1) source code
 
cpv_all(self)
Return all CPVs in the db Args: None Returns: A list of Strings, 1 per CPV
source code
 
cp_all(self)
Implement this in a child class...
source code
 
aux_get(self, mycpv, mylist, myrepo=None)
Return the metadata keys in mylist for mycpv Args: mycpv - "sys-apps/foo-1.0" mylist - ["SLOT","DEPEND","HOMEPAGE"] myrepo - The repository name.
source code
 
aux_update(self, cpv, metadata_updates)
Args:...
source code
 
match(self, origdep, use_cache=1)
Given a dependency, try to find packages that match...
source code
 
_iter_match(self, atom, cpv_iter) source code
 
_pkg_str(self, cpv, repo)
This is used to contruct _pkg_str instances on-demand during matching.
source code
 
_iter_match_repo(self, atom, cpv_iter) source code
 
_iter_match_slot(self, atom, cpv_iter) source code
 
_iter_match_use(self, atom, cpv_iter)
1) Check for required IUSE intersection (need implicit IUSE here).
source code
 
_match_use(self, atom, pkg, metadata) source code
 
invalidentry(self, mypath) source code
 
update_ents(self, updates, onProgress=None, onUpdate=None)
Update metadata of all packages for package moves.
source code
 
move_slot_ent(self, mylist, repo_match=None)
This function takes a sequence:...
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_cmp_cpv(cpv1, cpv2) source code
 
_cpv_sort_ascending(cpv_list)
Use this to sort self.cp_list() results in ascending order.
source code
Class Variables [hide private]
  _category_re = re.compile(r'(?u)^\w[-\.\+\w]*$')
  _categories = None
hash(x)
  _use_mutable = False
  _known_keys = frozenset([u'DEFINED_PHASES', u'DEPEND', u'DESCR...
  _pkg_str_aux_keys = (u'EAPI', u'KEYWORDS', u'SLOT', u'reposito...
Properties [hide private]
  categories
Use self.cp_all() to generate a category list.

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

_cpv_sort_ascending(cpv_list)
Static Method

source code 

Use this to sort self.cp_list() results in ascending order. It sorts in place and returns None.

cpv_all(self)

source code 
Return all CPVs in the db
Args:
        None
Returns:
        A list of Strings, 1 per CPV

This function relies on a subclass implementing cp_all, this is why the hasattr is there

cp_all(self)

source code 
Implement this in a child class
Args
        None
Returns:
        A list of strings 1 per CP in the datastore

aux_get(self, mycpv, mylist, myrepo=None)

source code 
Return the metadata keys in mylist for mycpv
Args:
        mycpv - "sys-apps/foo-1.0"
        mylist - ["SLOT","DEPEND","HOMEPAGE"]
        myrepo - The repository name.
Returns: 
        a list of results, in order of keys in mylist, such as:
        ["0",">=sys-libs/bar-1.0","http://www.foo.com"] or [] if mycpv not found'

aux_update(self, cpv, metadata_updates)

source code 

Args:
  cpv - "sys-apps/foo-1.0"
        metadata_updates = { key : newvalue }
Returns:
        None

match(self, origdep, use_cache=1)

source code 
Given a dependency, try to find packages that match
Args:
        origdep - Depend atom
        use_cache - Boolean indicating if we should use the cache or not
        NOTE: Do we ever not want the cache?
Returns:
        a list of packages that match origdep

_pkg_str(self, cpv, repo)

source code 

This is used to contruct _pkg_str instances on-demand during matching. If cpv is a _pkg_str instance with slot attribute, then simply return it. Otherwise, fetch metadata and construct a _pkg_str instance. This may raise KeyError or InvalidData.

_iter_match_use(self, atom, cpv_iter)

source code 

1) Check for required IUSE intersection (need implicit IUSE here). 2) Check enabled/disabled flag states.

update_ents(self, updates, onProgress=None, onUpdate=None)

source code 

Update metadata of all packages for package moves.

Parameters:
  • updates (list or dict) - A list of move commands, or dict of {repo_name: list}
  • onProgress (a callable that takes 2 integer arguments: maxval and curval) - A progress callback function
  • onUpdate (a callable that takes 2 integer arguments: maxval and curval) - A progress callback function called only for packages that are modified by updates.

move_slot_ent(self, mylist, repo_match=None)

source code 
This function takes a sequence:
Args:
        mylist: a sequence of (atom, originalslot, newslot)
        repo_match: callable that takes single repo_name argument
                and returns True if the update should be applied
Returns:
        The number of slotmoves this function did


Class Variable Details [hide private]

_known_keys

Value:
frozenset([u'DEFINED_PHASES',
           u'DEPEND',
           u'DESCRIPTION',
           u'EAPI',
           u'HDEPEND',
           u'HOMEPAGE',
           u'INHERITED',
           u'IUSE',
...

_pkg_str_aux_keys

Value:
(u'EAPI', u'KEYWORDS', u'SLOT', u'repository')

Property Details [hide private]

categories

Use self.cp_all() to generate a category list. Mutable instances can delete the self._categories attribute in cases when the cached categories become invalid and need to be regenerated.

Get Method:
unreachable.categories(self) - Use self.cp_all() to generate a category list.