summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-10 04:38:32 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-10 04:38:32 +0000
commit64042f15908946f17a96821eff85f4481b336001 (patch)
treeb8257e091c0f6acaa01dd19d8db8b1766a5aaad1 /pym/portage.py
parent1e27b9090e51d4280b7ddbb2d58bf62c67274e3c (diff)
downloadportage-64042f15908946f17a96821eff85f4481b336001.tar.gz
portage-64042f15908946f17a96821eff85f4481b336001.tar.bz2
portage-64042f15908946f17a96821eff85f4481b336001.zip
Add docstrings for FetchlistDict.
svn path=/main/trunk/; revision=3114
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 33b57718f..0021ea95a 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6344,7 +6344,12 @@ class dblink:
return os.path.exists(self.dbdir+"/CATEGORY")
class FetchlistDict(UserDict.DictMixin):
+ """This provide a mapping interface to retrieve fetch lists. It's used
+ to allow portage_manifest.Manifest to access fetch lists via a standard
+ mapping interface rather than use the dbapi directly."""
def __init__(self, pkgdir, settings):
+ """pkgdir is a directory containing ebuilds and settings is passed into
+ portdbapi.getfetchlist for __getitem__ calls."""
self.pkgdir = pkgdir
self.cp = os.sep.join(pkgdir.split(os.sep)[-2:])
self.settings = settings
@@ -6353,10 +6358,13 @@ class FetchlistDict(UserDict.DictMixin):
# This ensures that the fetchlist comes from the correct portage tree.
self.db.porttrees = [porttree]
def __getitem__(self, pkg_key):
+ """Returns the complete fetch list for a given package."""
return self.db.getfetchlist(pkg_key, mysettings=self.settings, all=True)[1]
def has_key(self, pkg_key):
- return self.db.cpv_exists(pkg_key)
+ """Returns true if the given package exists within pkgdir."""
+ return pkg_key in self.keys()
def keys(self):
+ """Returns keys for all packages within pkgdir"""
return self.db.cp_list(self.cp)
def cleanup_pkgmerge(mypkg,origdir):