remove default theme, add retweet count and favorites count
authorOrakaro <nhatminh_179@hotmail.com>
Sat, 9 Aug 2014 16:13:47 +0000 (01:13 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Sat, 9 Aug 2014 16:13:47 +0000 (01:13 +0900)
12 files changed:
docs/conf.py
docs/index.rst
rainbowstream/colorset/config
rainbowstream/colorset/default.json [deleted file]
rainbowstream/colorset/larapaste.json
rainbowstream/colorset/monokai.json
rainbowstream/colorset/solarized.json
rainbowstream/colorset/tomorrow_night.json
rainbowstream/draw.py
rainbowstream/rainbow.py
setup.py
theme.md

index 2f370415a00c897c150f798a2691696de160e95b..0f10c6f963ab2a0e2ba9bda846e5342926763ec6 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '0.6.8'
+version = '0.6.9'
 # The full version, including alpha/beta/rc tags.
-release = '0.6.8'
+release = '0.6.9'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 545002b4aef76bf1255d13f48bf33d0dfa98e9fd..377d21f5df33840a364d2205329ff43eafe3f058 100644 (file)
@@ -254,8 +254,6 @@ Here is full list of supported command:
 \r
 -  ``q`` will quit.\r
 \r
-Available commands are listed in `Read The Docs`_.\r
-\r
 Theme customization\r
 ^^^^^^^^^^^^^^^^^^^\r
 \r
@@ -334,8 +332,11 @@ You can view or set a new value of every config key by ``config`` command (See *
     + ``#name``: Twitter's name\r
     + ``#nick``: Twitter's screen name\r
     + ``#clock``: Datetime\r
+    + ``#rt_count``: retweets count\r
+    + ``#fa_count``: favorites count\r
     + ``#id``: ID\r
     + ``#fav``: favorited symbol\r
+    + ``#fav``: favorited symbol\r
     + ``#tweet``: Tweet's content\r
     + ``#sender_name``: Message's sender name\r
     + ``#sender_nick``: Message's sender screen name\r
index 2003630d2579f7dbf4fcb65dd40a803403065d41..086ec40860617bbd545fb1d3825c81bec93e497c 100644 (file)
@@ -37,7 +37,7 @@
     "FORMAT": {
         "TWEET": {
             "CLOCK_FORMAT" : "%Y/%m/%d %H:%M:%S",
-            "DISPLAY" : "\n  #name #nick :\n  [#clock] [id=#id] #fav\n  #tweet"
+            "DISPLAY" : "\n  #name #nick :\n  [#clock] [rt:#rt_count] [fav:#fa_count] [id=#id] #fav\n  #tweet"
         },
         "MESSAGE": {
             "CLOCK_FORMAT" : "%Y/%m/%d %H:%M:%S",
diff --git a/rainbowstream/colorset/default.json b/rainbowstream/colorset/default.json
deleted file mode 100644 (file)
index cfa251c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-{
-    /* Color config
-    There are 16 basic colors supported :
-        * default
-        * black
-        * red
-        * green
-        * yellow
-        * blue
-        * magenta
-        * cyan
-        * grey
-        * light_red
-        * light_green
-        * light_yellow
-        * light_blue
-        * light_magenta
-        * light_cyan
-        * white
-    and 256 colors from term_0 to term_255
-     */
-
-    "DECORATED_NAME" : "grey",
-    "CYCLE_COLOR" :["light_red","light_green","light_yellow","light_blue","light_magenta","light_cyan"],
-    "TWEET" : {
-        "nick"      : "grey",
-        "clock"     : "grey",
-        "id"        : "grey",
-        "favorited" : "light_green",
-        "rt"        : "grey",
-        "link"      : "light_cyan",
-        "hashtag"   : "grey",
-        "keyword"   : "on_light_yellow"
-    },
-
-    "MESSAGE" : {
-        "sender"    : "grey",
-        "recipient" : "grey",
-        "to"        : "light_magenta",
-        "clock"     : "grey",
-        "id"        : "grey"
-    },
-
-    "PROFILE" : {
-        "statuses_count"    : "light_green",
-        "friends_count"     : "light_green",
-        "followers_count"   : "light_green",
-        "nick"              : "grey",
-        "profile_image_url" : "light_cyan",
-        "description"       : "light_yellow",
-        "location"          : "light_magenta",
-        "url"               : "light_cyan",
-        "clock"             : "white"
-    },
-
-    "TREND" : {
-        "url": "light_cyan"
-    },
-
-    "CAL" : {
-        "days": "grey",
-        "today": "on_grey"
-    },
-
-    "GROUP" : {
-        "name": "grey",
-        "member": "light_green",
-        "subscriber": "light_green",
-        "mode": "grey",
-        "description": "light_yellow",
-        "clock": "grey"
-    }
-}
index a89e095dc89b557c1bf00289ca9f17646253413d..87c6d98d521607034d20018909c22458487e7887 100644 (file)
     "DECORATED_NAME" : 73,
     "CYCLE_COLOR" :[73,209,148,230,220,59],
     "TWEET" : {
-        "nick"      : 73,
-        "clock"     : 220,
-        "id"        : 209,
-        "favorited" : 148,
-        "rt"        : 59,
-        "link"      : 148,
-        "hashtag"   : 73,
-        "keyword"   : "on_light_green"
+        "nick"            : 73,
+        "clock"           : 220,
+        "id"              : 209,
+        "favorited"       : 148,
+        "retweet_count"   : 73,
+        "favorite_count"  : 148,
+        "rt"              : 59,
+        "link"            : 148,
+        "hashtag"         : 73,
+        "keyword"         : "on_light_green"
     },
 
     "MESSAGE" : {
index b0741c16111bd8dced334edbe21ed9f9a020aa6b..4365b7c63a57cff04daaf0052bbe2e7aa0552faa 100644 (file)
     "DECORATED_NAME" : 198,
     "CYCLE_COLOR" :[198,57,166,50,179,74,112],
     "TWEET" : {
-        "nick"      : 112,
-        "clock"     : 57,
-        "id"        : 166,
-        "favorited" : 50,
-        "rt"        : 179,
-        "link"      : 74,
-        "hashtag"   : 198,
-        "keyword"   : "on_light_green"
+        "nick"            : 112,
+        "clock"           : 57,
+        "id"              : 166,
+        "favorited"       : 50,
+        "retweet_count"   : 198,
+        "favorite_count"  : 50,
+        "rt"              : 179,
+        "link"            : 74,
+        "hashtag"         : 198,
+        "keyword"         : "on_light_green"
     },
 
     "MESSAGE" : {
index efb1dd4e581b2baf2feecd138747f2bab0480e74..6340d7418e1dea9c47b4728ec342193644aef3f3 100644 (file)
     "DECORATED_NAME" : 64,
     "CYCLE_COLOR" :[124,32,64,66,130,23],
     "TWEET" : {
-        "nick"      : 64,
-        "clock"     : 32,
-        "id"        : 124,
-        "favorited" : 64,
-        "rt"        : 66,
-        "link"      : 23,
-        "hashtag"   : 64,
-        "keyword"   : "on_light_green"
+        "nick"            : 64,
+        "clock"           : 32,
+        "id"              : 124,
+        "favorited"       : 64,
+        "retweet_count"   : 130,
+        "favorite_count"  : 64,
+        "rt"              : 66,
+        "link"            : 23,
+        "hashtag"         : 64,
+        "keyword"         : "on_light_green"
     },
 
     "MESSAGE" : {
index 57590b0cdbf52cdda7c84e57274cf84dd54bbda9..1939de23da827ec6f8d3700855c1cb88da695e5f 100644 (file)
     "DECORATED_NAME" : 103,
     "CYCLE_COLOR" :[103,173,30,54,58,179,145],
     "TWEET" : {
-        "nick"      : 103,
-        "clock"     : 58,
-        "id"        : 173,
-        "favorited" : 54,
-        "rt"        : 145,
-        "link"      : 30,
-        "hashtag"   : 103,
-        "keyword"   : "on_light_blue"
+        "nick"            : 103,
+        "clock"           : 58,
+        "id"              : 173,
+        "favorited"       : 54,
+        "retweet_count"   : 103,
+        "favorite_count"  : 54,
+        "rt"              : 145,
+        "link"            : 30,
+        "hashtag"         : 103,
+        "keyword"         : "on_light_blue"
     },
 
     "MESSAGE" : {
index 5dd078807b32946e40db1d561b123c51e693d4ef..bae4106974ac171646efdda90b6d960783fac378 100644 (file)
@@ -165,6 +165,8 @@ def draw(t, keyword=None, check_semaphore=False, fil=[], ig=[]):
     name = t['user']['name']
     created_at = t['created_at']
     favorited = t['favorited']
+    retweet_count = t['retweet_count']
+    favorite_count = t['favorite_count']
     date = parser.parse(created_at)
     date = date - datetime.timedelta(seconds=time.timezone)
     clock_format = '%Y/%m/%d %H:%M:%S'
@@ -270,6 +272,7 @@ def draw(t, keyword=None, check_semaphore=False, fil=[], ig=[]):
             tweet = delimiter.join(ary)
 
     # Load config formater
+    formater = ''
     try:
         formater = c['FORMAT']['TWEET']['DISPLAY']
         formater = name.join(formater.split("#name"))
@@ -285,9 +288,18 @@ def draw(t, keyword=None, check_semaphore=False, fil=[], ig=[]):
         word = [w for w in formater.split() if '#id' in w][0]
         delimiter = color_func(c['TWEET']['id'])(id.join(word.split('#id')))
         formater = delimiter.join(formater.split(word))
+        # Change retweet count word
+        word = [w for w in formater.split() if '#rt_count' in w][0]
+        delimiter = color_func(c['TWEET']['retweet_count'])(
+            str(retweet_count).join(word.split('#rt_count')))
+        formater = delimiter.join(formater.split(word))
+        # Change favorites count word
+        word = [w for w in formater.split() if '#fa_count' in w][0]
+        delimiter = color_func(c['TWEET']['favorite_count'])(
+            str(favorite_count).join(word.split('#fa_count')))
+        formater = delimiter.join(formater.split(word))
     except:
-        printNicely(red('Wrong format in config.'))
-        return
+        pass
 
     # Draw
     printNicely(formater)
index c66ae9af31b2e669dd081557f74fbebb52a8f91b..f456a8467dddf6db8708595d9176422fd77e414f 100644 (file)
@@ -1206,7 +1206,8 @@ def theme():
                 c['DECORATED_NAME'])(
                 '[' + x + ']: ')
             printNicely(green('Theme changed.'))
-        except:
+        except Exception as e:
+            print(e)
             printNicely(red('No such theme exists.'))
 
 
index 48949bc25806fa3dc86ce976d2972e9fac37c393..43574cfca6916d3eb75a57288ce85dd888910eb8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '0.6.8'
+version = '0.6.9'
 
 # Require
 install_requires = [
index 29164024865bf6e3c479f6571a49d2ed226ba6ca..6a28446a43ed334beec6f8b24edde023b5ee2bf6 100644 (file)
--- a/theme.md
+++ b/theme.md
@@ -1,6 +1,4 @@
 ## Available themes
-#### Default
-![Default](./screenshot/themes/Default.png)
 #### Monokai
 ![Monokai](./screenshot/themes/Monokai.png)
 #### Solarized