aboutsummaryrefslogtreecommitdiffstats
path: root/IRC/getconf.py
diff options
context:
space:
mode:
Diffstat (limited to 'IRC/getconf.py')
-rw-r--r--IRC/getconf.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/IRC/getconf.py b/IRC/getconf.py
new file mode 100644
index 0000000..5fdd1cd
--- /dev/null
+++ b/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