diff options
author | Till Maas <opensource@till.name> | 2009-07-26 21:07:06 +0200 |
---|---|---|
committer | Till Maas <opensource@till.name> | 2009-07-26 21:07:06 +0200 |
commit | d1f567fbc01a098c2e2d704170425a77a3edc396 (patch) | |
tree | ac891900e0f2c7a75af66c84ecb5671c75fde484 /cnucnu/config.py | |
parent | 179e8af64e3855d0395dcfcbeec8aaa298c8016c (diff) | |
download | cnucnu-d1f567fbc01a098c2e2d704170425a77a3edc396.tar.gz cnucnu-d1f567fbc01a098c2e2d704170425a77a3edc396.tar.xz cnucnu-d1f567fbc01a098c2e2d704170425a77a3edc396.zip |
first epydoc experiments
Diffstat (limited to 'cnucnu/config.py')
-rwxr-xr-x | cnucnu/config.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/cnucnu/config.py b/cnucnu/config.py index 13910d0..af497df 100755 --- a/cnucnu/config.py +++ b/cnucnu/config.py @@ -1,6 +1,6 @@ #!/usr/bin/python # vim: fileencoding=utf8 foldmethod=marker -#{{{ License header: GPLv2+ +# {{{ License header: GPLv2+ # This file is part of cnucnu. # # Cnucnu is free software: you can redistribute it and/or modify @@ -15,7 +15,12 @@ # # You should have received a copy of the GNU General Public License # along with cnucnu. If not, see <http://www.gnu.org/licenses/>. -#}}} +# }}} +""" :author: Till Maas + :contact: opensource@till.name + :license: GPLv2+ +""" +__docformat__ = "restructuredtext" from helper import pprint, filter_dict import yaml @@ -64,6 +69,8 @@ package list: """ class Config(object): + """ Config management class for cnucnu. + """ def __init__(self, yaml_file=None, yaml=None, yaml_data=None, config=None, load_default=True): # TODO: remove yaml option if yaml_data: @@ -102,6 +109,15 @@ class Config(object): return old def update(self, new, old=None): + """ Update dictionary with new values recursively. + + :Parameters: + new : dict + new dictionary + old : dict + old dictionary, defaults to self.config + + """ if not old: old = self.config for k, v in new.items(): @@ -115,11 +131,6 @@ class Config(object): self._bugzilla_config = {} return old - -# D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k] -# (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k] - - @property def bugzilla_config(self): if not self._bugzilla_config: |