add color for hashtag and try catch for quit() in ctrl+c
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Mon, 28 Jul 2014 04:19:11 +0000 (13:19 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Mon, 28 Jul 2014 04:19:11 +0000 (13:19 +0900)
docs/conf.py
rainbowstream/colorset/default.json
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

index 5afa34a1be9127a787966e098b36b0517bed1533..e5b64fe487273d33e2a3ce064374a33784393169 100644 (file)
@@ -51,9 +51,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
 # built documents.
 #
 # The short X.Y version.
-version = '0.5.5'
+version = '0.5.6'
 # The full version, including alpha/beta/rc tags.
 # The full version, including alpha/beta/rc tags.
-release = '0.5.5'
+release = '0.5.6'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 134891d9f187429889262d24643f799aa8fd0d96..cfa251c952960c233227c36903de4ef7af132964 100644 (file)
@@ -29,6 +29,7 @@
         "favorited" : "light_green",
         "rt"        : "grey",
         "link"      : "light_cyan",
         "favorited" : "light_green",
         "rt"        : "grey",
         "link"      : "light_cyan",
+        "hashtag"   : "grey",
         "keyword"   : "on_light_yellow"
     },
 
         "keyword"   : "on_light_yellow"
     },
 
index 47635229c3c9e1e4af5fc0d75e519c001a37df48..a89e095dc89b557c1bf00289ca9f17646253413d 100644 (file)
@@ -29,6 +29,7 @@
         "favorited" : 148,
         "rt"        : 59,
         "link"      : 148,
         "favorited" : 148,
         "rt"        : 59,
         "link"      : 148,
+        "hashtag"   : 73,
         "keyword"   : "on_light_green"
     },
 
         "keyword"   : "on_light_green"
     },
 
index 27d79829d0cb52f9e72fcc59e7056d1f49956fc3..b0741c16111bd8dced334edbe21ed9f9a020aa6b 100644 (file)
@@ -29,6 +29,7 @@
         "favorited" : 50,
         "rt"        : 179,
         "link"      : 74,
         "favorited" : 50,
         "rt"        : 179,
         "link"      : 74,
+        "hashtag"   : 198,
         "keyword"   : "on_light_green"
     },
 
         "keyword"   : "on_light_green"
     },
 
index b73cc708796a54475647fe17839e2769125137ba..efb1dd4e581b2baf2feecd138747f2bab0480e74 100644 (file)
@@ -29,6 +29,7 @@
         "favorited" : 64,
         "rt"        : 66,
         "link"      : 23,
         "favorited" : 64,
         "rt"        : 66,
         "link"      : 23,
+        "hashtag"   : 64,
         "keyword"   : "on_light_green"
     },
 
         "keyword"   : "on_light_green"
     },
 
index c09027449786aef490fbd67d8ea9fb55eb2d85de..57590b0cdbf52cdda7c84e57274cf84dd54bbda9 100644 (file)
@@ -29,6 +29,7 @@
         "favorited" : 54,
         "rt"        : 145,
         "link"      : 30,
         "favorited" : 54,
         "rt"        : 145,
         "link"      : 30,
+        "hashtag"   : 103,
         "keyword"   : "on_light_blue"
     },
 
         "keyword"   : "on_light_blue"
     },
 
index 218aa42b509b714ee591060d74b7a6a5c6bf94a6..589d5f3a8ccb8944bb6b264b6ca83e996de06ab4 100644 (file)
@@ -270,7 +270,11 @@ def draw(t, keyword=None, check_semaphore=False, fil=[], ig=[]):
             c['TWEET']['link'])(x) if x[
             0:4] == 'http' else x,
         tweet)
             c['TWEET']['link'])(x) if x[
             0:4] == 'http' else x,
         tweet)
-
+    # Highlight hashtag
+    tweet = lmap(
+        lambda x: color_func(
+            c['TWEET']['hashtag'])(x) if x.startswith('#') else x,
+        tweet)
     # Highlight keyword
     tweet = ' '.join(tweet)
     if keyword:
     # Highlight keyword
     tweet = ' '.join(tweet)
     if keyword:
index c721189cccb7cb0322c1cee366d54eb3b8aef548..a9ee2bab32b421d1d5dcee1dcbcdff27ade09dfe 100644 (file)
@@ -1471,10 +1471,13 @@ def quit():
     """
     Exit all
     """
     """
     Exit all
     """
-    save_history()
-    os.system('rm -rf rainbow.db')
-    os.kill(g['stream_pid'], signal.SIGKILL)
-    printNicely(green('See you next time :)'))
+    try:
+        save_history()
+        os.system('rm -rf rainbow.db')
+        os.kill(g['stream_pid'], signal.SIGKILL)
+        printNicely(green('See you next time :)'))
+    except:
+        pass
     sys.exit()
 
 
     sys.exit()
 
 
@@ -1711,9 +1714,8 @@ def fly():
     except TwitterHTTPError:
         printNicely('')
         printNicely(
     except TwitterHTTPError:
         printNicely('')
         printNicely(
-            magenta("Something wrong with Twitter Oauth right now :("))
-        printNicely(
-            magenta("Please delete ~/.rainbow_oauth and try again."))
+            magenta("We have maximum connection problem with twitter'stream API right now :("))
+        printNicely(magenta("Let's try again later."))
         save_history()
         os.system('rm -rf rainbow.db')
         sys.exit()
         save_history()
         os.system('rm -rf rainbow.db')
         sys.exit()
index 0c15d7af59d2411b877e291d82861d096ace51e1..f1b0a3307f928c6d720828a003e2dcb79e464afe 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 import os, os.path, sys
 
 # Bumped version
 import os, os.path, sys
 
 # Bumped version
-version = '0.5.5'
+version = '0.5.6'
 
 # Require
 install_requires = [
 
 # Require
 install_requires = [