Package _emerge :: Module PackageVirtualDbapi :: Class PackageVirtualDbapi
[hide private]

Class PackageVirtualDbapi

source code

         object --+    
                  |    
portage.dbapi.dbapi --+
                      |
                     PackageVirtualDbapi
Known Subclasses:

A dbapi-like interface class that represents the state of the installed package database as new packages are installed, replacing any packages that previously existed in the same slot. The main difference between this class and fakedbapi is that this one uses Package instances internally (passed in via cpv_inject() and cpv_remove() calls).

Instance Methods [hide private]
 
__init__(self, settings)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clear(self)
Remove all packages.
source code
 
copy(self) source code
 
__bool__(self) source code
 
__nonzero__(self) source code
 
__iter__(self) source code
 
__contains__(self, item) source code
 
get(self, item, default=None) source code
 
match_pkgs(self, atom) source code
 
_clear_cache(self) source code
 
match(self, origdep, use_cache=1)
Given a dependency, try to find packages that match...
source code
 
cpv_exists(self, cpv, myrepo=None) source code
 
cp_list(self, mycp, use_cache=1) source code
 
cp_all(self)
Implement this in a child class...
source code
 
cpv_all(self)
Return all CPVs in the db Args: None Returns: A list of Strings, 1 per CPV
source code
 
cpv_inject(self, pkg) source code
 
cpv_remove(self, pkg) source code
 
aux_get(self, cpv, wants, 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, values)
Args:...
source code

Inherited from portage.dbapi.dbapi: close_caches, invalidentry, move_slot_ent, update_ents

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

Static Methods [hide private]

Inherited from portage.dbapi.dbapi (private): _cmp_cpv, _cpv_sort_ascending

Class Variables [hide private]
Properties [hide private]

Inherited from portage.dbapi.dbapi: categories

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

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

Overrides: portage.dbapi.dbapi.match
(inherited documentation)

cp_list(self, mycp, use_cache=1)

source code 
Overrides: portage.dbapi.dbapi.cp_list

cp_all(self)

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

Overrides: portage.dbapi.dbapi.cp_all
(inherited documentation)

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

Overrides: portage.dbapi.dbapi.cpv_all
(inherited documentation)

aux_get(self, cpv, wants, 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'

Overrides: portage.dbapi.dbapi.aux_get
(inherited documentation)

aux_update(self, cpv, values)

source code 

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

Overrides: portage.dbapi.dbapi.aux_update
(inherited documentation)