summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/cache/template.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pym/cache/template.py b/pym/cache/template.py
index 419ec08a4..7389a142e 100644
--- 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