projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f3ce47
)
Implement get() as part of the standard mapping interface. This patch is from trunk...
author
Zac Medico
<zmedico@gentoo.org>
Wed, 21 Jun 2006 04:14:34 +0000
(
04:14
-0000)
committer
Zac Medico
<zmedico@gentoo.org>
Wed, 21 Jun 2006 04:14:34 +0000
(
04:14
-0000)
svn path=/main/branches/2.1/; revision=3580
pym/cache/template.py
patch
|
blob
|
history
diff --git
a/pym/cache/template.py
b/pym/cache/template.py
index 097ebed8d623fbe3303f36a1a5c180b86035a8fc..43f3c8a14ae60c1a726edc6ea31b577e1ba824c9 100644
(file)
--- a/
pym/cache/template.py
+++ b/
pym/cache/template.py
@@
-115,6
+115,12
@@
class database(object):
def __contains__(self, cpv):
return self.has_key(cpv)
+ def get(self, k, x=None):
+ try:
+ return self[k]
+ except KeyError:
+ return x
+
def get_matches(self, match_dict):
"""generic function for walking the entire cache db, matching restrictions to
filter what cpv's are returned. Derived classes should override this if they