From 8394e34ba2fb669ba12071835166b6a32fa0cfe1 Mon Sep 17 00:00:00 2001 From: Vu Nhat Minh Date: Thu, 3 Jul 2014 14:58:27 +0900 Subject: [PATCH] fix bug --- rainbowstream/config.py | 4 ++-- rainbowstream/draw.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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('') -- 2.25.1