X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Fconfig.py;h=4b4aef6fbc44bd15dc587067d9c584361b13c71e;hp=418afbb0a03411a1a563cdb5d479c4c5c43c4215;hb=4cf86720f0c6834b4af48c577685237f59447937;hpb=c075e6dcf76153c0209b16e12771ae491f4b175a diff --git a/rainbowstream/config.py b/rainbowstream/config.py index 418afbb..4b4aef6 100644 --- a/rainbowstream/config.py +++ b/rainbowstream/config.py @@ -3,6 +3,10 @@ import re import os import os.path +from .db import * + +db = RainbowDB() + # Regular expression for comments comment_re = re.compile( '(^)?[^\S\n]*/(?:\*(.*?)\*/[^\S\n]*|/[^\n]*)($)?', @@ -21,8 +25,10 @@ def load_config(filepath): while match: content = content[:match.start()] + content[match.end():] match = comment_re.search(content) + db.theme_store('user') return json.loads(content) - except: + except IOError: + db.theme_store('default') pass # Load default colorset