projects
/
rainbowstream.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quote and pause bug fix
[rainbowstream.git]
/
rainbowstream
/
draw.py
diff --git
a/rainbowstream/draw.py
b/rainbowstream/draw.py
index 4fbe82723f46861c422dafb28d7ab3cb4abb7bf8..bfa3e2c7fa69461fe5502cdcb33f51a6b43a93cc 100644
(file)
--- a/
rainbowstream/draw.py
+++ b/
rainbowstream/draw.py
@@
-144,18
+144,10
@@
def color_func(func_name):
return globals()[func_name]
return globals()[func_name]
-def draw(t, keyword=None, humanize=True,
check_semaphore=False,
fil=[], ig=[]):
+def draw(t, keyword=None, humanize=True, fil=[], ig=[]):
"""
Draw the rainbow
"""
"""
Draw the rainbow
"""
-
- # Check the semaphore pause and lock (stream process only)
- if check_semaphore:
- if c['pause']:
- return
- while c['lock']:
- time.sleep(0.5)
-
# Check config
check_config()
# Check config
check_config()
@@
-318,18
+310,10
@@
def draw(t, keyword=None, humanize=True, check_semaphore=False, fil=[], ig=[]):
printNicely(red('Sorry, image link is broken'))
printNicely(red('Sorry, image link is broken'))
-def print_message(m
, check_semaphore=False
):
+def print_message(m):
"""
Print direct message
"""
"""
Print direct message
"""
-
- # Check the semaphore pause and lock (stream process only)
- if check_semaphore:
- if c['pause']:
- return
- while c['lock']:
- time.sleep(0.5)
-
# Retrieve message
sender_screen_name = '@' + m['sender_screen_name']
sender_name = m['sender']['name']
# Retrieve message
sender_screen_name = '@' + m['sender_screen_name']
sender_name = m['sender']['name']
@@
-574,31
+558,31
@@
def format_quote(tweet):
except:
pass
# Highlight like a tweet
except:
pass
# Highlight like a tweet
-
formater
= formater.split()
-
formater
= lmap(
+
notice
= formater.split()
+
notice
= lmap(
lambda x: light_green(x)
if x == '#comment'
else x,
lambda x: light_green(x)
if x == '#comment'
else x,
-
formater
)
-
formater
= lmap(
+
notice
)
+
notice
= lmap(
lambda x: color_func(c['TWEET']['rt'])(x)
if x == 'RT'
else x,
lambda x: color_func(c['TWEET']['rt'])(x)
if x == 'RT'
else x,
-
formater
)
-
formater = lmap(lambda x: cycle_color(x) if x[0] == '@' else x, formater
)
-
formater
= lmap(
+
notice
)
+
notice = lmap(lambda x: cycle_color(x) if x[0] == '@' else x, notice
)
+
notice
= lmap(
lambda x: color_func(c['TWEET']['link'])(x)
if x[0:4] == 'http'
else x,
lambda x: color_func(c['TWEET']['link'])(x)
if x[0:4] == 'http'
else x,
-
formater
)
-
formater
= lmap(
+
notice
)
+
notice
= lmap(
lambda x: color_func(c['TWEET']['hashtag'])(x)
if x.startswith('#')
else x,
lambda x: color_func(c['TWEET']['hashtag'])(x)
if x.startswith('#')
else x,
-
formater
)
-
formater = ' '.join(formater
)
+
notice
)
+
notice = ' '.join(notice
)
# Notice
# Notice
- notice = light_magenta('Quoting: "') +
formater
+ light_magenta('"')
+ notice = light_magenta('Quoting: "') +
notice
+ light_magenta('"')
printNicely(notice)
return formater
printNicely(notice)
return formater