+def check_theme():
+ """
+ Check current theme and update if necessary
+ """
+ exists = db.theme_query()
+ themes = [t.theme_name for t in exists]
+ if c['theme'] != themes[0]:
+ c['theme'] = themes[0]
+ # Determine path
+ if c['theme'] == 'custom':
+ config = os.environ.get(
+ 'HOME',
+ os.environ.get(
+ 'USERPROFILE',
+ '')) + os.sep + '.rainbow_config.json'
+ else:
+ config = 'rainbowstream/colorset/'+c['theme']+'.json'
+ # Load new config
+ data = load_config(config)
+ if data:
+ for d in data:
+ c[d] = data[d]
+