From 571ea706e5688d01bd83bafbbe601a0d94ac90ab Mon Sep 17 00:00:00 2001 From: Orakaro Date: Wed, 27 Aug 2014 01:06:27 +0900 Subject: [PATCH] add color for my nick and fix https open bug --- docs/conf.py | 4 ++-- rainbowstream/colorset/larapaste.json | 1 + rainbowstream/colorset/monokai.json | 1 + rainbowstream/colorset/solarized.json | 1 + rainbowstream/colorset/tomorrow_night.json | 1 + rainbowstream/draw.py | 5 ++++- rainbowstream/rainbow.py | 7 +++---- setup.py | 2 +- theme.md | 3 ++- 9 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3ae8929..367ae8f 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 = '0.8.9' +version = '0.9.0' # The full version, including alpha/beta/rc tags. -release = '0.8.9' +release = '0.9.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/rainbowstream/colorset/larapaste.json b/rainbowstream/colorset/larapaste.json index a6bdb45..495a63b 100644 --- a/rainbowstream/colorset/larapaste.json +++ b/rainbowstream/colorset/larapaste.json @@ -23,6 +23,7 @@ "DECORATED_NAME" : 37, "CYCLE_COLOR" :[37,184,202,154,59,230], "TWEET" : { + "mynick" : 202, "nick" : 37, "clock" : 184, "id" : 184, diff --git a/rainbowstream/colorset/monokai.json b/rainbowstream/colorset/monokai.json index d9c7bb3..68365ca 100644 --- a/rainbowstream/colorset/monokai.json +++ b/rainbowstream/colorset/monokai.json @@ -23,6 +23,7 @@ "DECORATED_NAME" : 198, "CYCLE_COLOR" :[198,57,166,50,179,74,112], "TWEET" : { + "mynick" : 179, "nick" : 112, "clock" : 57, "id" : 166, diff --git a/rainbowstream/colorset/solarized.json b/rainbowstream/colorset/solarized.json index e9eb1e0..99863e5 100644 --- a/rainbowstream/colorset/solarized.json +++ b/rainbowstream/colorset/solarized.json @@ -23,6 +23,7 @@ "DECORATED_NAME" : 64, "CYCLE_COLOR" :[124,32,64,66,130,23], "TWEET" : { + "mynick" : 66, "nick" : 64, "clock" : 32, "id" : 130, diff --git a/rainbowstream/colorset/tomorrow_night.json b/rainbowstream/colorset/tomorrow_night.json index 3bd27dc..d48b683 100644 --- a/rainbowstream/colorset/tomorrow_night.json +++ b/rainbowstream/colorset/tomorrow_night.json @@ -23,6 +23,7 @@ "DECORATED_NAME" : 67, "CYCLE_COLOR" :[67,166,30,97,58,179,145], "TWEET" : { + "mynick" : 145, "nick" : 67, "clock" : 58, "id" : 58, diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index 5bde76c..9ce1897 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -223,7 +223,10 @@ def draw(t, keyword=None, humanize=True, fil=[], ig=[]): # Format info name = cycle_color(name) - nick = color_func(c['TWEET']['nick'])(screen_name) + if mytweet: + nick = color_func(c['TWEET']['mynick'])(screen_name) + else: + nick = color_func(c['TWEET']['nick'])(screen_name) clock = clock id = str(rid) fav = '' diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 5542ca7..f58d59c 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -461,10 +461,9 @@ def urlopen(): return tid = c['tweet_dict'][int(g['stuff'])] tweet = t.statuses.show(id=tid) - link_ary = [ - u for u in tweet['text'].split() if u.startswith('http://')] - link_ary.extend([ - u for u in tweet['text'].split() if u.startswith('https://')]) + link_prefix = ('http://', 'https://') + link_ary = [u for u in tweet['text'].split() + if u.startswith(link_prefix)] if not link_ary: printNicely(light_magenta('No url here @.@!')) return diff --git a/setup.py b/setup.py index 447c9da..da18822 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '0.8.9' +version = '0.9.0' # Require install_requires = [ diff --git a/theme.md b/theme.md index 6e27d09..1ad272f 100644 --- a/theme.md +++ b/theme.md @@ -134,7 +134,8 @@ Color reference can be found at * Color selection is cycle through this list but with _memoization_. * It's means that same names will appear in same colors. * `TWEET`: colors of parts in a tweet's ouput. - * `nick` : color for Twitter __username__. + * `mynick` : color for your Twitter __username__. + * `nick` : color for other Twitter __username__. * `clock`: color for time of tweet. * `id`: color for tweet's id. * `favorite`: color for the star symbol when a tweet is favorited by you. -- 2.25.1