keyword None
authorOrakaro <nhatminh_179@hotmail.com>
Sun, 25 May 2014 11:23:49 +0000 (20:23 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Sun, 25 May 2014 11:23:49 +0000 (20:23 +0900)
rainbowstream/rainbow.py

index 84b89ffcf6a8f3988bef4c0c72257dbf98641297..9570fee261d8f43dcaece15dfb9e4371d35da010 100644 (file)
@@ -42,7 +42,8 @@ def draw(t,keyword=None):
     # Highlight link
     tweet = map(lambda x: cyan(x) if x[0:7] == 'http://' else x, tweet)
     # Highlight search keyword
     # Highlight link
     tweet = map(lambda x: cyan(x) if x[0:7] == 'http://' else x, tweet)
     # Highlight search keyword
-    tweet = map(lambda x: on_yellow(x) if ''.join(c for c in x if c.isalnum()).lower() == keyword.lower() else x, tweet)
+    if keyword:
+        tweet = map(lambda x: on_yellow(x) if ''.join(c for c in x if c.isalnum()).lower() == keyword.lower() else x, tweet)
     tweet = ' '.join(tweet)
 
     # Draw rainbow
     tweet = ' '.join(tweet)
 
     # Draw rainbow