diff options
Diffstat (limited to 'Reaktor/IRC/getconf.py')
-rw-r--r-- | Reaktor/IRC/getconf.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Reaktor/IRC/getconf.py b/Reaktor/IRC/getconf.py index f9cd4404..168c908c 100644 --- a/Reaktor/IRC/getconf.py +++ b/Reaktor/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 |