return json.loads(content)
except IOError:
db.theme_store('default')
- pass
+ return None
# Load default colorset
c = {}
default_config = 'rainbowstream/colorset/default.json'
data = load_config(default_config)
-for d in data:
- c[d] = data[d]
+if data:
+ for d in data:
+ c[d] = data[d]
# Load user's colorset
rainbow_config = os.environ.get(
'HOME',
'USERPROFILE',
'')) + os.sep + '.rainbow_config.json'
data = load_config(rainbow_config)
-for d in data:
- c[d] = data[d]
+if data:
+ for d in data:
+ c[d] = data[d]
config = 'rainbowstream/colorset/'+cur_theme+'.json'
# Load new config
data = load_config(config)
- for d in data:
- c[d] = data[d]
+ if data:
+ for d in data:
+ c[d] = data[d]
def color_func(func_name):
# Load new config
new_config = 'rainbowstream/colorset/' + g['stuff'] + '.json'
new_config = load_config(new_config)
- for nc in new_config:
- c[nc] = new_config[nc]
+ if new_config
+ for nc in new_config:
+ c[nc] = new_config[nc]
# Update db
theme_update(g['stuff'])
g['decorated_name'] = color_func(