summaryrefslogtreecommitdiffstats
path: root/Reaktor/IRC/getconf.py
diff options
context:
space:
mode:
Diffstat (limited to 'Reaktor/IRC/getconf.py')
-rw-r--r--Reaktor/IRC/getconf.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Reaktor/IRC/getconf.py b/Reaktor/IRC/getconf.py
new file mode 100644
index 00000000..5fdd1cdb
--- /dev/null
+++ b/Reaktor/IRC/getconf.py
@@ -0,0 +1,20 @@
+#getconf = make_getconf("dateiname.json")
+#getconf(key) -> value
+#oder error
+
+import json
+
+def make_getconf(filename):
+ def getconf(prop):
+ prop_split = prop.split('.')
+ string = ''
+ file = open(filename)
+ for line in file.readlines():
+ string+=line
+ parsed = json.loads(string)
+ tmp = parsed
+ for pr in prop_split:
+ tmp = tmp[pr]
+
+ return tmp
+ return getconf