summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-06 22:29:18 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-06 22:29:18 +0000
commitf007c608160bacfb0be88ff0cc2fabaf3c747537 (patch)
tree0363a7fce8a13ce2e330327b59584276407aaedb /pym
parentf018472f4b28f12f8c792bae7843ea3e6ea9f64f (diff)
downloadportage-f007c608160bacfb0be88ff0cc2fabaf3c747537.tar.gz
portage-f007c608160bacfb0be88ff0cc2fabaf3c747537.tar.bz2
portage-f007c608160bacfb0be88ff0cc2fabaf3c747537.zip
Add a portdbapi.getRepositoryName() method which is the inverse of
getRepositoryPath(). svn path=/main/trunk/; revision=15325
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index cf7eeac7f..5a845118d 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -452,6 +452,18 @@ class portdbapi(dbapi):
return self.treemap[repository_id]
return None
+ def getRepositoryName(self, canonical_repo_path):
+ """
+ This is the inverse of getRepositoryPath().
+ @param canonical_repo_path: the canonical path of a repository, as
+ resolved by os.path.realpath()
+ @type canonical_repo_path: String
+ @returns: The repo_name for the corresponding repository, or None
+ if the path does not correspond a known repository
+ @rtype: String or None
+ """
+ return self._repository_map.get(canonical_repo_path)
+
def getRepositories(self):
"""
This function is required for GLEP 42 compliance; it will return a list of