aboutsummaryrefslogtreecommitdiffstats
path: root/IRC/getconf.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-04-27 18:17:23 +0200
committermakefu <github@syntax-fehler.de>2014-04-27 18:17:23 +0200
commit4b367ce717a91eda21337ff85a64fcb3f38db61d (patch)
tree84d2aa2aa045657afb573ed862c0510353e70e2e /IRC/getconf.py
parent3005c4701cade073dbc2285e3629cb516b4a3cec (diff)
parent8ba1237707cf9da18344d2725e5d867f93dcd3c3 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
Diffstat (limited to 'IRC/getconf.py')
-rw-r--r--IRC/getconf.py7
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