From 3b1912ee9c8127a1f3458d3272d9e3b134bda46e Mon Sep 17 00:00:00 2001 From: Orakaro Date: Thu, 25 Sep 2014 02:34:49 +0900 Subject: [PATCH] fix bug when #client not exist --- docs/conf.py | 4 ++-- rainbowstream/draw.py | 12 ++++++------ setup.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c0cbe38..481a919 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh' # built documents. # # The short X.Y version. -version = '1.0.8' +version = '1.0.9' # The full version, including alpha/beta/rc tags. -release = '1.0.8' +release = '1.0.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index dd32297..a947506 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -328,6 +328,7 @@ def draw(t, keyword=None, humanize=True, noti=False, fil=[], ig=[]): formater = nick.join(formater.split('#nick')) formater = fav.join(formater.split('#fav')) formater = tweet.join(formater.split('#tweet')) + formater = emojize(formater) # Change clock word word = [wo for wo in formater.split() if '#clock' in wo][0] delimiter = color_func(c['TWEET']['clock'])( @@ -337,11 +338,6 @@ def draw(t, keyword=None, humanize=True, noti=False, fil=[], ig=[]): word = [wo for wo in formater.split() if '#id' in wo][0] delimiter = color_func(c['TWEET']['id'])(id.join(word.split('#id'))) formater = delimiter.join(formater.split(word)) - # Change client word - word = [wo for wo in formater.split() if '#client' in wo][0] - delimiter = color_func(c['TWEET']['client'])( - client.join(word.split('#client'))) - formater = delimiter.join(formater.split(word)) # Change retweet count word word = [wo for wo in formater.split() if '#rt_count' in wo][0] delimiter = color_func(c['TWEET']['retweet_count'])( @@ -352,7 +348,11 @@ def draw(t, keyword=None, humanize=True, noti=False, fil=[], ig=[]): delimiter = color_func(c['TWEET']['favorite_count'])( str(favorite_count).join(word.split('#fa_count'))) formater = delimiter.join(formater.split(word)) - formater = emojize(formater) + # Change client word + word = [wo for wo in formater.split() if '#client' in wo][0] + delimiter = color_func(c['TWEET']['client'])( + client.join(word.split('#client'))) + formater = delimiter.join(formater.split(word)) except: pass diff --git a/setup.py b/setup.py index 82eed6e..4cb4e69 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '1.0.8' +version = '1.0.9' # Require install_requires = [ -- 2.25.1