term color define only by number
authorOrakaro <nhatminh_179@hotmail.com>
Tue, 15 Jul 2014 15:40:46 +0000 (00:40 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Tue, 15 Jul 2014 15:40:46 +0000 (00:40 +0900)
rainbowstream/colorset/init [deleted file]
rainbowstream/colorset/larapaste.json
rainbowstream/colorset/monokai.json
rainbowstream/colorset/solarized.json
rainbowstream/colorset/tomorrow_night.json
rainbowstream/draw.py
setup.py
theme.md

diff --git a/rainbowstream/colorset/init b/rainbowstream/colorset/init
deleted file mode 100755 (executable)
index 1d8a01d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-monokai\r
\ No newline at end of file
index 990b4f802fefc07195d3cfca5b5ff8c47f35ea4a..47635229c3c9e1e4af5fc0d75e519c001a37df48 100644 (file)
         * light_magenta
         * light_cyan
         * white
-    and 256 terminal's colors from term_0 to term_255
+    and 256 terminal's colors from 0 to 255
     */
 
-    "DECORATED_NAME" : "term_73",
-    "CYCLE_COLOR" :["term_73","term_209","term_148","term_230","term_220","term_59"],
+    "DECORATED_NAME" : 73,
+    "CYCLE_COLOR" :[73,209,148,230,220,59],
     "TWEET" : {
-        "nick"      : "term_73",
-        "clock"     : "term_220",
-        "id"        : "term_209",
-        "favorited" : "term_148",
-        "rt"        : "term_59",
-        "link"      : "term_148",
+        "nick"      : 73,
+        "clock"     : 220,
+        "id"        : 209,
+        "favorited" : 148,
+        "rt"        : 59,
+        "link"      : 148,
         "keyword"   : "on_light_green"
     },
 
     "MESSAGE" : {
-        "sender"    : "term_73",
-        "recipient" : "term_73",
-        "to"        : "term_148",
-        "clock"     : "term_220",
-        "id"        : "term_209"
+        "sender"    : 73,
+        "recipient" : 73,
+        "to"        : 148,
+        "clock"     : 220,
+        "id"        : 209
     },
 
     "PROFILE" : {
-        "statuses_count"    : "term_209",
-        "friends_count"     : "term_73",
-        "followers_count"   : "term_220",
-        "nick"              : "term_73",
-        "profile_image_url" : "term_148",
-        "description"       : "term_230",
-        "location"          : "term_59",
-        "url"               : "term_148",
-        "clock"             : "term_220"
+        "statuses_count"    : 209,
+        "friends_count"     : 73,
+        "followers_count"   : 220,
+        "nick"              : 73,
+        "profile_image_url" : 148,
+        "description"       : 230,
+        "location"          : 59,
+        "url"               : 148,
+        "clock"             : 220
     },
 
     "TREND" : {
-        "url": "term_148"
+        "url": 148
     },
 
     "CAL" : {
-        "days": "term_209",
+        "days": 209,
         "today": "on_light_magenta"
     },
 
     "GROUP" : {
-        "name": "term_73",
-        "member": "term_220",
-        "subscriber": "term_73",
-        "mode": "term_59",
-        "description": "term_230",
-        "clock": "term_220"
+        "name": 73,
+        "member": 220,
+        "subscriber": 73,
+        "mode": 59,
+        "description": 230,
+        "clock": 220
     }
 }
index dc71fda58fe2c3eb26d41b7efc87a60bae07461e..27d79829d0cb52f9e72fcc59e7056d1f49956fc3 100644 (file)
         * light_magenta
         * light_cyan
         * white
-    and 256 terminal's colors from term_0 to term_255
+    and 256 terminal's colors from 0 to 255
     */
 
-    "DECORATED_NAME" : "term_198",
-    "CYCLE_COLOR" :["term_198","term_57","term_166","term_50","term_179","term_74","term_112"],
+    "DECORATED_NAME" : 198,
+    "CYCLE_COLOR" :[198,57,166,50,179,74,112],
     "TWEET" : {
-        "nick"      : "term_112",
-        "clock"     : "term_57",
-        "id"        : "term_166",
-        "favorited" : "term_50",
-        "rt"        : "term_179",
-        "link"      : "term_74",
+        "nick"      : 112,
+        "clock"     : 57,
+        "id"        : 166,
+        "favorited" : 50,
+        "rt"        : 179,
+        "link"      : 74,
         "keyword"   : "on_light_green"
     },
 
     "MESSAGE" : {
-        "sender"    : "term_112",
-        "recipient" : "term_112",
-        "to"        : "term_50",
-        "clock"     : "term_57",
-        "id"        : "term_166"
+        "sender"    : 112,
+        "recipient" : 112,
+        "to"        : 50,
+        "clock"     : 57,
+        "id"        : 166
     },
 
     "PROFILE" : {
-        "statuses_count"    : "term_112",
-        "friends_count"     : "term_198",
-        "followers_count"   : "term_57",
-        "nick"              : "term_198",
-        "profile_image_url" : "term_74",
-        "description"       : "term_166",
-        "location"          : "term_112",
-        "url"               : "term_74",
-        "clock"             : "term_57"
+        "statuses_count"    : 112,
+        "friends_count"     : 198,
+        "followers_count"   : 57,
+        "nick"              : 198,
+        "profile_image_url" : 74,
+        "description"       : 166,
+        "location"          : 112,
+        "url"               : 74,
+        "clock"             : 57
     },
 
     "TREND" : {
-        "url": "term_74"
+        "url": 74
     },
 
     "CAL" : {
-        "days": "term_57",
+        "days": 57,
         "today": "on_light_blue"
     },
 
     "GROUP" : {
-        "name": "term_112",
-        "member": "term_57",
-        "subscriber": "term_198",
-        "mode": "term_112",
-        "description": "term_166",
-        "clock": "term_57"
+        "name": 112,
+        "member": 57,
+        "subscriber": 198,
+        "mode": 112,
+        "description": 166,
+        "clock": 57
     }
 }
index b3b3c2cc65cf38c9ae2a171960d40caad10332c6..b73cc708796a54475647fe17839e2769125137ba 100644 (file)
         * light_magenta
         * light_cyan
         * white
-    and 256 terminal's colors from term_0 to term_255
+    and 256 terminal's colors from 0 to 255
     */
 
-    "DECORATED_NAME" : "term_64",
-    "CYCLE_COLOR" :["term_124","term_32","term_64","term_66","term_130","term_23"],
+    "DECORATED_NAME" : 64,
+    "CYCLE_COLOR" :[124,32,64,66,130,23],
     "TWEET" : {
-        "nick"      : "term_64",
-        "clock"     : "term_32",
-        "id"        : "term_124",
-        "favorited" : "term_64",
-        "rt"        : "term_66",
-        "link"      : "term_23",
+        "nick"      : 64,
+        "clock"     : 32,
+        "id"        : 124,
+        "favorited" : 64,
+        "rt"        : 66,
+        "link"      : 23,
         "keyword"   : "on_light_green"
     },
 
     "MESSAGE" : {
-        "sender"    : "term_64",
-        "recipient" : "term_64",
-        "to"        : "term_130",
-        "clock"     : "term_32",
-        "id"        : "term_124"
+        "sender"    : 64,
+        "recipient" : 64,
+        "to"        : 130,
+        "clock"     : 32,
+        "id"        : 124
     },
 
     "PROFILE" : {
-        "statuses_count"    : "term_124",
-        "friends_count"     : "term_32",
-        "followers_count"   : "term_130",
-        "nick"              : "term_64",
-        "profile_image_url" : "term_23",
-        "description"       : "term_66",
-        "location"          : "term_64",
-        "url"               : "term_23",
-        "clock"             : "term_32"
+        "statuses_count"    : 124,
+        "friends_count"     : 32,
+        "followers_count"   : 130,
+        "nick"              : 64,
+        "profile_image_url" : 23,
+        "description"       : 66,
+        "location"          : 64,
+        "url"               : 23,
+        "clock"             : 32
     },
 
     "TREND" : {
-        "url": "term_23"
+        "url": 23
     },
 
     "CAL" : {
-        "days": "term_64",
+        "days": 64,
         "today": "light_green"
     },
 
     "GROUP" : {
-        "name": "term_64",
-        "member": "term_130",
-        "subscriber": "term_32",
-        "mode": "term_164",
-        "description": "term_66",
-        "clock": "term_32"
+        "name": 64,
+        "member": 130,
+        "subscriber": 32,
+        "mode": 164,
+        "description": 66,
+        "clock": 32
     }
 }
index 9dcd03aeb4ea3bbb286751e0cfc1a8457f97573b..c09027449786aef490fbd67d8ea9fb55eb2d85de 100644 (file)
         * light_magenta
         * light_cyan
         * white
-    and 256 terminal's colors from term_0 to term_255
+    and 256 terminal's colors from 0 to 255
     */
 
-    "DECORATED_NAME" : "term_103",
-    "CYCLE_COLOR" :["term_103","term_173","term_30","term_54","term_58","term_179","term_145"],
+    "DECORATED_NAME" : 103,
+    "CYCLE_COLOR" :[103,173,30,54,58,179,145],
     "TWEET" : {
-        "nick"      : "term_103",
-        "clock"     : "term_58",
-        "id"        : "term_173",
-        "favorited" : "term_54",
-        "rt"        : "term_145",
-        "link"      : "term_30",
+        "nick"      : 103,
+        "clock"     : 58,
+        "id"        : 173,
+        "favorited" : 54,
+        "rt"        : 145,
+        "link"      : 30,
         "keyword"   : "on_light_blue"
     },
 
     "MESSAGE" : {
-        "sender"    : "term_103",
-        "recipient" : "term_103",
-        "to"        : "term_54",
-        "clock"     : "term_58",
-        "id"        : "term_173"
+        "sender"    : 103,
+        "recipient" : 103,
+        "to"        : 54,
+        "clock"     : 58,
+        "id"        : 173
     },
 
     "PROFILE" : {
-        "statuses_count"    : "term_173",
-        "friends_count"     : "term_30",
-        "followers_count"   : "term_179",
-        "nick"              : "term_103",
-        "profile_image_url" : "term_30",
-        "description"       : "term_58",
-        "location"          : "term_54",
-        "url"               : "term_30",
-        "clock"             : "term_58"
+        "statuses_count"    : 173,
+        "friends_count"     : 30,
+        "followers_count"   : 179,
+        "nick"              : 103,
+        "profile_image_url" : 30,
+        "description"       : 58,
+        "location"          : 54,
+        "url"               : 30,
+        "clock"             : 58
     },
 
     "TREND" : {
-        "url": "term_30"
+        "url": 30
     },
 
     "CAL" : {
-        "days": "term_103",
+        "days": 103,
         "today": "on_light_blue"
     },
 
     "GROUP" : {
-        "name": "term_103",
-        "member": "term_179",
-        "subscriber": "term_30",
-        "mode": "term_54",
-        "description": "term_58",
-        "clock": "term_173"
+        "name": 103,
+        "member": 179,
+        "subscriber": 30,
+        "mode": 54,
+        "description": 58,
+        "clock": 173
     }
 }
index a24ce03d90f57a6d96d824c4fdadb90b10e7cb66..0abdedee7657245f2380c1f020de20a0a4f2cee8 100644 (file)
@@ -24,8 +24,8 @@ def init_cycle():
     Init the cycle
     """
     colors_shuffle = [globals()[i.encode('utf8')]
-                      if not i.startswith('term_')
-                      else term_color(int(i[5:]))
+                      if not str(i).isdigit()
+                      else term_color(int(i))
                       for i in c['CYCLE_COLOR']]
     return itertools.cycle(colors_shuffle)
 g['cyc'] = init_cycle()
@@ -45,8 +45,8 @@ def order_rainbow(s):
     Print a string with ordered color with each character
     """
     colors_shuffle = [globals()[i.encode('utf8')]
-                      if not i.startswith('term_')
-                      else term_color(int(i[5:]))
+                      if not str(i).isdigit()
+                      else term_color(int(i))
                       for i in c['CYCLE_COLOR']]
     colored = [colors_shuffle[i % 7](s[i]) for i in xrange(len(s))]
     return ''.join(colored)
@@ -57,8 +57,8 @@ def random_rainbow(s):
     Print a string with random color with each character
     """
     colors_shuffle = [globals()[i.encode('utf8')]
-                      if not i.startswith('term_')
-                      else term_color(int(i[5:]))
+                      if not str(i).isdigit()
+                      else term_color(int(i))
                       for i in c['CYCLE_COLOR']]
     colored = [random.choice(colors_shuffle)(i) for i in s]
     return ''.join(colored)
@@ -135,8 +135,8 @@ def color_func(func_name):
     """
     Call color function base on name
     """
-    if func_name.startswith('term_') and func_name[5:].isdigit():
-        return term_color(int(func_name[5:]))
+    if str(func_name).isdigit():
+        return term_color(int(func_name))
     return globals()[func_name]
 
 
index 2e7a14d1de0742af43943320fb866c4070d1a2fc..1448f17cbe3ff7471a0d16fcb2f692795bf51f49 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 import os, sys
 
 # Bumped version
-version = '0.3.6'
+version = '0.3.7'
 
 # Require
 install_requires = [
index 51fb321af1fd78e7ed5ca13e4fe242d9649b831d..29164024865bf6e3c479f6571a49d2ed226ba6ca 100644 (file)
--- a/theme.md
+++ b/theme.md
@@ -24,44 +24,44 @@ Examples are available in
 
 ```json
 {
-    "DECORATED_NAME" : "term_198",
-    "CYCLE_COLOR" :["term_198","term_57","term_166","term_50","term_179","term_74","term_112"],
+    "DECORATED_NAME" : 198,
+    "CYCLE_COLOR" :[198,57,166,50,179,74,112],
     "TWEET" : {
-        "nick"      : "term_112",
-        "clock"     : "term_57",
-        "id"        : "term_166",
-        "favourite" : "term_50",
-        "rt"        : "term_179",
-        "link"      : "term_74",
+        "nick"      : 112,
+        "clock"     : 57,
+        "id"        : 166,
+        "favourite" : 50,
+        "rt"        : 179,
+        "link"      : 74,
         "keyword"   : "on_light_green"
     },
 
     "MESSAGE" : {
-        "sender"    : "term_112",
-        "recipient" : "term_112",
-        "to"        : "term_50",
-        "clock"     : "term_57",
-        "id"        : "term_166"
+        "sender"    : 112,
+        "recipient" : 112,
+        "to"        : 50,
+        "clock"     : 57,
+        "id"        : 166
     },
 
     "PROFILE" : {
-        "statuses_count"    : "term_112",
-        "friends_count"     : "term_198",
-        "followers_count"   : "term_57",
-        "nick"              : "term_198",
-        "profile_image_url" : "term_74",
-        "description"       : "term_166",
-        "location"          : "term_112",
-        "url"               : "term_74",
-        "clock"             : "term_57"
+        "statuses_count"    : 112,
+        "friends_count"     : 198,
+        "followers_count"   : 57,
+        "nick"              : 198,
+        "profile_image_url" : 74,
+        "description"       : 166,
+        "location"          : 112,
+        "url"               : 74,
+        "clock"             : 57
     },
 
     "TREND" : {
-        "url": "term_74"
+        "url": 74
     },
-    
+
     "CAL" : {
-        "days": "term_57",
+        "days": 57,
         "today": "on_light_blue"
     }
 }
@@ -89,7 +89,7 @@ There are 16 basic colors:
 
 These colors will be enough for almost terminals.
 But if your terminal can support 256 colors (check your `$TERM` variable!),
-you can even use `term_0` to `term_255` as the example above.
+you can even use 0 to 255 as the example above.
 
 There are also background highlight colors like:
   * on_default