diff options
Diffstat (limited to 'IRC/getconf.py')
-rw-r--r-- | IRC/getconf.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/IRC/getconf.py b/IRC/getconf.py index f9cd440..168c908 100644 --- a/IRC/getconf.py +++ b/IRC/getconf.py @@ -9,14 +9,17 @@ import os def make_getconf(filename): - def getconf(prop): + def getconf(prop, default_value=None): prop_split = prop.split('.') string = '' config = load_config(filename) #imp.reload(config) tmp = config.__dict__ for pr in prop_split: - tmp = tmp[pr] + if pr in tmp: + tmp = tmp[pr] + else: + return default_value return tmp return getconf |