From: Vu Nhat Minh Date: Thu, 3 Jul 2014 05:58:27 +0000 (+0900) Subject: fix bug X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=commitdiff_plain;h=8394e34ba2fb669ba12071835166b6a32fa0cfe1 fix bug --- diff --git a/rainbowstream/config.py b/rainbowstream/config.py index 828a517..697361d 100644 --- a/rainbowstream/config.py +++ b/rainbowstream/config.py @@ -25,10 +25,8 @@ 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 IOError: - db.theme_store('default') return None # Load default colorset @@ -38,6 +36,7 @@ data = load_config(default_config) if data: for d in data: c[d] = data[d] +db.theme_store('default') # Load user's colorset rainbow_config = os.environ.get( 'HOME', @@ -48,3 +47,4 @@ data = load_config(rainbow_config) if data: for d in data: c[d] = data[d] + db.theme_update('user') diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index ab50d01..ff931ce 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -305,6 +305,6 @@ def print_trends(trends): for topic in trends[:c['TREND_MAX']]: name = topic['name'] url = topic['url'] - line = cycle_color(name) + ': ' + color_func(TREND['url'])(url) + line = cycle_color(name) + ': ' + color_func(c['TREND']['url'])(url) printNicely(line) printNicely('')