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.')
"""
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]
Init configuration
"""
# Load the initial config
- config = os.path.dirname(
- __file__) + '/colorset/config'
+ config = os.path.dirname(__file__) + \
+ '/colorset/config'
try:
data = load_config(config)
for d in data:
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__) + '/colorset/' + c['THEME'] + '.json'
+ theme_file = os.path.dirname(__file__) + \
+ '/colorset/' + c['THEME'] + '.json'
try:
data = load_config(theme_file)
for d in data: