From 04610460050d47adec2e7b9c8a354b6ee99a6317 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Sat, 14 Feb 2015 14:44:54 +0900 Subject: [PATCH] minor fix --- docs/conf.py | 4 ++-- rainbowstream/rainbow.py | 16 ++++++++++++++-- setup.py | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index ea902b8..c14d68b 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.2.5' +version = '1.2.6' # The full version, including alpha/beta/rc tags. -release = '1.2.5' +release = '1.2.6' # 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 2e153c8..5241f0d 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -324,7 +324,11 @@ def whois(): Show profile of a specific user """ t = Twitter(auth=authen()) - screen_name = g['stuff'].split()[0] + try: + screen_name = g['stuff'].split()[0] + except: + printNicely(red('Sorry I can\'t understand.')) + return if screen_name.startswith('@'): try: user = t.users.show( @@ -343,7 +347,11 @@ def view(): Friend view """ t = Twitter(auth=authen()) - user = g['stuff'].split()[0] + try: + user = g['stuff'].split()[0] + except: + printNicely(red('Sorry I can\'t understand.')) + return if user[0] == '@': try: num = int(g['stuff'].split()[1]) @@ -364,6 +372,9 @@ def search(): t = Twitter(auth=authen()) # Setup query query = g['stuff'].strip() + if not query: + printNicely(red('Sorry I can\'t understand.')) + return type = c['SEARCH_TYPE'] if type not in ['mixed', 'recent', 'popular']: type = 'mixed' @@ -780,6 +791,7 @@ def ls(): target = g['stuff'].split()[0] except: printNicely(red('Omg some syntax is wrong.')) + return # Init cursor d = {'fl': 'followers', 'fr': 'friends'} next_cursor = -1 diff --git a/setup.py b/setup.py index 084daf3..32e1d62 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '1.2.5' +version = '1.2.6' # Require install_requires = [ -- 2.25.1