22 |
|
|
23 |
import ConfigParser |
import ConfigParser |
24 |
|
|
25 |
class Config(ConfigParser): |
class Config(ConfigParser.ConfigParser): |
26 |
"""A ConfigParser module with our defaults auto-loaded |
"""A ConfigParser module with our defaults auto-loaded |
27 |
""" |
""" |
28 |
|
|
29 |
user_config = None |
user_config = None |
30 |
defaults = { |
defaults = { |
31 |
"modules:dir": "/usr/share/circus/modules" |
"modules_dir": "/usr/share/circus/modules" |
32 |
} |
} |
33 |
|
|
34 |
def __init__(self): |
def __init__(self): |
35 |
parent.__init__(self.defaults) |
ConfigParser.ConfigParser.__init__(self, self.conf_defaults) |
|
# XXX: test |
|
|
self.user_config = "/home/tvon/.circus.cfg" |
|
36 |
|
|
37 |
|
|
38 |
def debug_print(self): |
def debug_print(self): |
39 |
config.read(self.user_config) |
self.read(self.user_config) |
40 |
for section in self.sections(): |
for section in self.sections(): |
41 |
print section |
print section |
42 |
for option in self.options(section): |
for option in self.options(section): |