]> khamidou — GitHub mirrors - cagibi.git/commitdiff
added a file to handle a config file.
authorkarim hamidou <khamidou@gmail.com>
Thu, 12 Jul 2012 07:46:54 +0000 (09:46 +0200)
committerkarim hamidou <khamidou@gmail.com>
Thu, 12 Jul 2012 07:46:54 +0000 (09:46 +0200)
cagibi/config.py [new file with mode: 0644]

diff --git a/cagibi/config.py b/cagibi/config.py
new file mode 100644 (file)
index 0000000..d4ac402
--- /dev/null
@@ -0,0 +1,9 @@
+import json
+
+def load_config(filename="config.json"):
+    """load a configuration file in json"""
+    return json.load(open(filename))
+
+def save_config(config, filename="config.json"):
+    """save a configuration file"""
+    json.dump(config, open(filename, 'w'))