check config and little refactoring
[rainbowstream.git] / rainbowstream / config.py
index de15655cfe3c0890334a32cb79d46c810bb9ee07..ff2d17df7e51db45591898f5ca442f46d5e853de 100644 (file)
@@ -25,6 +25,16 @@ def load_config(filepath):
 # Config dictionary
 c = {}
 
 # Config dictionary
 c = {}
 
+# Load the initial config
+config = os.path.dirname(
+    __file__) + '/colorset/config'
+try:
+    data = load_config(config)
+    for d in data:
+        c[d] = data[d]
+except:
+    pass
+
 # Load user's config
 rainbow_config = os.environ.get(
     'HOME',
 # Load user's config
 rainbow_config = os.environ.get(
     'HOME',
@@ -36,7 +46,7 @@ try:
     for d in data:
         c[d] = data[d]
 except:
     for d in data:
         c[d] = data[d]
 except:
-    pass
+    print('It seems that ~/.rainbow_config.json has wrong format :(')
 
 # Load default theme
 theme_file = os.path.dirname(
 
 # Load default theme
 theme_file = os.path.dirname(