From d7d9c67c828cc917c2c0bb5f84a7f76efbb0ab93 Mon Sep 17 00:00:00 2001 From: vunhat_minh Date: Fri, 12 Sep 2014 12:50:57 +0900 Subject: [PATCH] fix notification duplicate bug --- docs/conf.py | 4 ++-- rainbowstream/rainbow.py | 11 ++++------- setup.py | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index dfa7d32..ad07f8a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh' # built documents. # # The short X.Y version. -version = '1.0.1' +version = '1.0.2' # The full version, including alpha/beta/rc tags. -release = '1.0.1' +release = '1.0.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 6a565f9..dd7fffc 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -168,14 +168,12 @@ def init(args): g['themes'] = themes g['pause'] = False g['message_threads'] = {} - # Events - g['events'] = [] # Startup cmd g['cmd'] = '' # Debug option default = True g['debug'] = True g['traceback'] = [] - # Retweet of mine events + # Events c['events'] = [] # Semaphore init c['lock'] = False @@ -242,9 +240,8 @@ def notification(): """ Show notifications """ - g['events'] = g['events'] + c['events'] - if g['events']: - for e in g['events']: + if c['events']: + for e in c['events']: print_event(e) printNicely('') else: @@ -1901,7 +1898,7 @@ def stream(domain, args, name='Rainbow Stream'): time.sleep(0.5) print_message(tweet['direct_message']) elif tweet.get('event'): - g['events'].append(tweet) + c['events'].append(tweet) print_event(tweet) except TwitterHTTPError: printNicely('') diff --git a/setup.py b/setup.py index ecadbcd..72076ae 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '1.0.1' +version = '1.0.2' # Require install_requires = [ -- 2.25.1