Implement config.pop(). (trunk r8688)
authorZac Medico <zmedico@gentoo.org>
Mon, 26 Nov 2007 17:31:40 +0000 (17:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 26 Nov 2007 17:31:40 +0000 (17:31 -0000)
svn path=/main/branches/2.1.2/; revision=8689

pym/portage.py

index e62355a9a6512415f376f2420e2c4d966ffbb3d8..b0325feb8b53a40fa8345705cc31884221e113fd 100644 (file)
@@ -2420,6 +2420,12 @@ class config:
                                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