add info and colored
[rainbowstream.git] / rainbowstream / config.py
index c2f2d5cd9ddba696a49e2f6bfe25c1155dbbd85a..58f747de33cf8ab627f1227137cc9e30be5227bc 100644 (file)
@@ -109,7 +109,7 @@ def delete_config(key):
     Delete a config key
     """
     path = os.path.expanduser("~") + os.sep + '.rainbow_config.json'
-    try: 
+    try:
         data = load_config(path)
     except:
         raise Exception('Config file is messed up.')
@@ -133,8 +133,9 @@ def reload_config():
     """
     Reload config
     """
-    try: 
-        rainbow_config = os.path.expanduser("~") + os.sep + '.rainbow_config.json'
+    try:
+        rainbow_config = os.path.expanduser("~") + \
+            os.sep + '.rainbow_config.json'
         data = load_config(rainbow_config)
         for d in data:
             c[d] = data[d]
@@ -161,7 +162,7 @@ def init_config():
         data = load_config(rainbow_config)
         for d in data:
             c[d] = data[d]
-    except ValueError as e:
+    except (IOError, ValueError) as e:
         c['USER_JSON_ERROR'] = str(e)
     # Load default theme
     theme_file = os.path.dirname(__file__) + \