summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-21 06:40:47 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-21 06:40:47 +0000
commit5737e903a88b3909b19751bcd5596158ca740c05 (patch)
tree736d5e80ac7cec28da69b34d2a325f61a8d6632d
parent443996ef1ad4cdc8fc48c1be018ebefbf1e4be74 (diff)
downloadportage-5737e903a88b3909b19751bcd5596158ca740c05.tar.gz
portage-5737e903a88b3909b19751bcd5596158ca740c05.tar.bz2
portage-5737e903a88b3909b19751bcd5596158ca740c05.zip
Implement portage.config.get() in order to provide more of the standard mapping interface.
svn path=/main/trunk/; revision=3182
-rw-r--r--pym/portage.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 3c026ebc6..13495c3dc 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1619,9 +1619,14 @@ class config:
if k in self:
return self[k]
else:
- myvalue = x
self[k] = x
- return myvalue
+ return x
+
+ def get(self, k, x=None):
+ if k in self:
+ return self[k]
+ else:
+ return x
def keys(self):
return unique_array(flatten([x.keys() for x in self.lookuplist]))