From 5737e903a88b3909b19751bcd5596158ca740c05 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 21 Apr 2006 06:40:47 +0000 Subject: Implement portage.config.get() in order to provide more of the standard mapping interface. svn path=/main/trunk/; revision=3182 --- pym/portage.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pym/portage.py') 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])) -- cgit v1.2.3-1-g7c22