From 1cf81d85b29568caac003b0960ceb71df4148945 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Sun, 20 Nov 2011 13:48:18 -0500 Subject: [PATCH] add a get method to the config object --- pecan/configuration.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pecan/configuration.py b/pecan/configuration.py index 7844ccd..cdb94fe 100644 --- a/pecan/configuration.py +++ b/pecan/configuration.py @@ -49,6 +49,11 @@ class Config(object): else: self[k] = conf_dict[k] + def get(self, attribute): + try: + return self[attribute] + except KeyError: + return None def __dictify__(self, obj, prefix): '''