Package portage :: Package dbapi :: Module virtual :: Class fakedbapi
[hide private]

Class fakedbapi

source code

object --+    
         |    
     dbapi --+
             |
            fakedbapi
Known Subclasses:

A fake dbapi that allows consumers to inject/remove packages to/from it portage.settings is required to maintain the dbAPI.

Instance Methods [hide private]
 
__init__(self, settings=None, exclusive_slots=True)
x.__init__(...) initializes x; see help(type(x)) for signature
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, mycpv, myrepo=None) source code
 
cp_list(self, mycp, use_cache=1, myrepo=None) 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, mycpv, metadata=None)
Adds a cpv to the list of available packages.
source code
 
cpv_remove(self, mycpv)
Removes a cpv from the list of available packages.
source code
 
aux_get(self, mycpv, 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 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 dbapi (private): _cmp_cpv, _cpv_sort_ascending

Class Variables [hide private]
Properties [hide private]

Inherited from dbapi: categories

Inherited from object: __class__

Method Details [hide private]

__init__(self, settings=None, exclusive_slots=True)
(Constructor)

source code 

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

Parameters:
  • exclusive_slots (Boolean) - When True, injecting a package with SLOT metadata causes an existing package in the same slot to be automatically removed (default is True).
Overrides: object.__init__

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: dbapi.match
(inherited documentation)

cp_list(self, mycp, use_cache=1, myrepo=None)

source code 
Overrides: 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: 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: dbapi.cpv_all
(inherited documentation)

cpv_inject(self, mycpv, metadata=None)

source code 

Adds a cpv to the list of available packages. See the exclusive_slots constructor parameter for behavior with respect to SLOT metadata.

Parameters:
  • mycpv (str) - cpv for the package to inject
  • metadata - dictionary of raw metadata for aux_get() calls
  • metadata - dict

aux_get(self, mycpv, 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: 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: dbapi.aux_update
(inherited documentation)