summaryrefslogtreecommitdiffstats
path: root/cnucnu/config.py
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2009-07-28 00:12:46 +0200
committerTill Maas <opensource@till.name>2009-07-28 00:12:46 +0200
commitb8e8d27d62fe2966a9ddec19b3ef363dfa6eb1ee (patch)
treee8afe2483f7405ecbfb556ea76790c6a5e4cb06d /cnucnu/config.py
parent81eb7b87b29871fabe35fd4a00d7246ab39682b3 (diff)
downloadcnucnu-b8e8d27d62fe2966a9ddec19b3ef363dfa6eb1ee.tar.gz
cnucnu-b8e8d27d62fe2966a9ddec19b3ef363dfa6eb1ee.tar.xz
cnucnu-b8e8d27d62fe2966a9ddec19b3ef363dfa6eb1ee.zip
provide global config, keep raw bugzilla config
Diffstat (limited to 'cnucnu/config.py')
-rwxr-xr-xcnucnu/config.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/cnucnu/config.py b/cnucnu/config.py
index 160bb86..c19afff 100755
--- a/cnucnu/config.py
+++ b/cnucnu/config.py
@@ -68,6 +68,7 @@ package list:
# vim: filetype=yaml
"""
+
class Config(object):
""" Config management class for cnucnu.
"""
@@ -134,7 +135,8 @@ class Config(object):
@property
def bugzilla_config(self):
if not self._bugzilla_config:
- b = self.config["bugzilla"]
+ b = {}
+ b.update(self.config["bugzilla"])
for c, v in b.items():
if isinstance(v, str):
b[c] = v % b
@@ -151,6 +153,7 @@ class Config(object):
def yaml(self):
return yaml.dump(self.config, indent=4, default_flow_style=False)
+global_config = Config()
if __name__ == '__main__':
@@ -158,6 +161,8 @@ if __name__ == '__main__':
print "Default config"
pprint(cf.config)
+ print "yaml of default config"
+ print cf.yaml
cf.update_yaml_file('../cnucnu.yaml')
@@ -170,5 +175,3 @@ if __name__ == '__main__':
print "\nBugzilla class config"
pprint(cf.bugzilla_class_conf)
- print
- print cf.yaml