diff options
author | Alfredo Deza <alfredodeza@gmail.com> | 2011-11-20 13:48:18 -0500 |
---|---|---|
committer | Alfredo Deza <alfredodeza@gmail.com> | 2011-11-20 13:58:01 -0500 |
commit | 1cf81d85b29568caac003b0960ceb71df4148945 (patch) | |
tree | df6977c42386207ff9759d1109024210bf3c6625 | |
parent | d2267aa0527edd20bb9c8375a5c65f92778fd27f (diff) | |
download | pecan-1cf81d85b29568caac003b0960ceb71df4148945.tar.gz |
add a get method to the config object
-rw-r--r-- | pecan/configuration.py | 5 |
1 files changed, 5 insertions, 0 deletions
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): ''' |