From 7a431249cb4233a83c7c6064994b2d98d08d6552 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Sun, 25 May 2014 20:23:49 +0900 Subject: [PATCH] keyword None --- rainbowstream/rainbow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 84b89ff..9570fee 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -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 - 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 -- 2.25.1