add color for hashtag and try catch for quit() in ctrl+c
[rainbowstream.git] / rainbowstream / draw.py
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)
-
+    # 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: