projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d914f7
)
Implement portage.config.setdefault() in order to provide more of the standard mappin...
author
Zac Medico
<zmedico@gentoo.org>
Tue, 18 Apr 2006 04:17:14 +0000
(
04:17
-0000)
committer
Zac Medico
<zmedico@gentoo.org>
Tue, 18 Apr 2006 04:17:14 +0000
(
04:17
-0000)
svn path=/main/trunk/; revision=3172
pym/portage.py
patch
|
blob
|
history
diff --git
a/pym/portage.py
b/pym/portage.py
index 7a8258547b6b9adc763b7e62b3a8f59eadc3218a..3c026ebc62c9e6ed88cd860782e1c0a639b7b2d2 100644
(file)
--- a/
pym/portage.py
+++ b/
pym/portage.py
@@
-1615,6
+1615,14
@@
class config:
"""Called to implement membership test operators (in and not in)."""
return bool(self.has_key(mykey))
+ def setdefault(self, k, x=None):
+ if k in self:
+ return self[k]
+ else:
+ myvalue = x
+ self[k] = x
+ return myvalue
+
def keys(self):
return unique_array(flatten([x.keys() for x in self.lookuplist]))