From: Zac Medico Date: Mon, 26 Nov 2007 17:28:51 +0000 (-0000) Subject: Implement config.pop(). X-Git-Tag: v2.2_pre1~308 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5110f6cf1561f95a5da9b1a578c68fe38ffcf4c2;p=portage.git Implement config.pop(). svn path=/main/trunk/; revision=8688 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 04b73b1b8..2fecfef38 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -2470,6 +2470,12 @@ class config(object): return d[k] return x + def pop(self, k, x=None): + v = x + for d in reversed(self.lookuplist): + v = d.pop(k, v) + return v + def has_key(self,mykey): return mykey in self