docs
authorOrakaro <nhatminh_179@hotmail.com>
Sat, 19 Jul 2014 07:36:51 +0000 (16:36 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Sat, 19 Jul 2014 07:36:51 +0000 (16:36 +0900)
rainbowstream/config.py
rainbowstream/rainbow.py

index d481dcd31e358a850e585996b0b8850b6201d964..e19f069f15893c7b296ee95df185e6b34b4e704a 100644 (file)
@@ -43,7 +43,11 @@ def get_all_config():
         os.environ.get(
             'USERPROFILE',
             '')) + os.sep + '.rainbow_config.json'
-    return load_config(path)
+    data = load_config(path)
+    # Hard to set from prompt
+    data.pop('ONLY_LIST',None)
+    data.pop('IGNORE_LIST',None)
+    return data
 
 
 def get_default_config(key):
index d4c1254d7e0d5972a16574f37b1d76f26cbebcdb..905ff77a82250ebd8cb68b2b8b55e43d04c137e9 100644 (file)
@@ -1092,7 +1092,7 @@ def config():
             line = ' '*2 + light_green(k) + ': ' + light_yellow(str(all_config[k]))
             printNicely(line)
         guide = 'Detailed explanation can be found at ' + \
-            color_func(c['TWEET']['link'])('http://rainbowstream.readthedocs.org/en/latest/')
+            color_func(c['TWEET']['link'])('http://rainbowstream.readthedocs.org/en/latest/#config-explanation')
         printNicely(guide)
     # Print specific config
     elif len(g['stuff'].split()) == 1:
@@ -1112,7 +1112,11 @@ def config():
     elif len(g['stuff'].split()) == 3 and g['stuff'].split()[1] == '=' :
         key = g['stuff'].split()[0]
         value = g['stuff'].split()[-1]
-        set_config(key,value)
+        try:
+            set_config(key,value)
+        except:
+            printNicely(light_magenta('Not valid value.'))
+            return
         reload_config()
     else:
         printNicely(light_magenta('Sorry I can\'s understand.'))