From 64156ac40c0e3c1ccacb78ed3a2c1939efa51a95 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Mon, 28 Jul 2014 09:27:39 +0900 Subject: [PATCH] handle ctrl+c --- docs/conf.py | 4 ++-- rainbowstream/rainbow.py | 4 ++++ setup.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 1d3359c..5afa34a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,9 +51,9 @@ copyright = u'2014, Vu Nhat Minh' # built documents. # # The short X.Y version. -version = '0.5.4' +version = '0.5.5' # The full version, including alpha/beta/rc tags. -release = '0.5.4' +release = '0.5.5' # 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 fbac32c..c721189 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -143,6 +143,9 @@ def init(args): """ Init function """ + # Handle Ctrl C + ctrl_c_handler = lambda signum, frame: quit() + signal.signal(signal.SIGINT, ctrl_c_handler) # Get name t = Twitter(auth=authen()) name = '@' + t.account.verify_credentials()['screen_name'] @@ -1471,6 +1474,7 @@ def quit(): save_history() os.system('rm -rf rainbow.db') os.kill(g['stream_pid'], signal.SIGKILL) + printNicely(green('See you next time :)')) sys.exit() diff --git a/setup.py b/setup.py index ae00494..0c15d7a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages import os, os.path, sys # Bumped version -version = '0.5.4' +version = '0.5.5' # Require install_requires = [ -- 2.25.1