From 1185824138756716dcce73b834cdbd23c8e233c0 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Wed, 3 Sep 2014 21:28:40 +0900 Subject: [PATCH] do nothing when meet other event in stream --- docs/conf.py | 4 ++-- rainbowstream/draw.py | 9 ++++++++- setup.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 647e44c..e012675 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 = '0.9.6' +version = '0.9.7' # The full version, including alpha/beta/rc tags. -release = '0.9.6' +release = '0.9.7' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index 5357945..e8cbcaf 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -846,6 +846,13 @@ def notify_list_user_unsubscribed(e): print_list(target_object, noti=True) +def nothing(e): + """ + Do nothing for other event + """ + return + + def print_event(e): """ Notify an event @@ -860,7 +867,7 @@ def print_event(e): 'list_user_subscribed': notify_list_user_subscribed, 'list_user_unsubscribed': notify_list_user_unsubscribed, } - event_dict[e['event']](e) + event_dict.get(e['event'],nothing)(e) def show_profile(u): diff --git a/setup.py b/setup.py index 0cbc272..2863774 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '0.9.6' +version = '0.9.7' # Require install_requires = [ -- 2.25.1