From baec5f507d4eeb9ef367538a0e3a1b309bb25768 Mon Sep 17 00:00:00 2001 From: vunhat_minh Date: Mon, 4 Aug 2014 19:30:11 +0900 Subject: [PATCH] help command not found --- docs/conf.py | 4 ++-- rainbowstream/rainbow.py | 29 +++++++++++++++++++++++------ setup.py | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 66ef9be..932239f 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.6.1' +version = '0.6.2' # The full version, including alpha/beta/rc tags. -release = '0.6.1' +release = '0.6.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 14149d9..2e8b1ca 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -198,7 +198,11 @@ def switch(): g['stream_stop'] = True args.track_keywords = keyword # Start new thread - th = threading.Thread(target=stream, args=(c['PUBLIC_DOMAIN'], args)) + th = threading.Thread( + target=stream, + args=( + c['PUBLIC_DOMAIN'], + args)) th.daemon = True th.start() # Personal stream @@ -206,7 +210,12 @@ def switch(): # Kill old thread g['stream_stop'] = True # Start new thread - th = threading.Thread(target=stream, args=(c['USER_DOMAIN'], args, g['original_name'])) + th = threading.Thread( + target=stream, + args=( + c['USER_DOMAIN'], + args, + g['original_name'])) th.daemon = True th.start() printNicely('') @@ -1136,7 +1145,7 @@ def config(): set_config(key, value) # Apply theme immediately if key == 'THEME': - c['THEME'] = reload_theme(value,c['THEME']) + c['THEME'] = reload_theme(value, c['THEME']) g['decorated_name'] = lambda x: color_func( c['DECORATED_NAME'])( '[' + x + ']: ') @@ -1166,7 +1175,7 @@ def theme(): # Change theme try: # Load new theme - c['THEME'] = reload_theme(g['stuff'],c['THEME']) + c['THEME'] = reload_theme(g['stuff'], c['THEME']) # Redefine decorated_name g['decorated_name'] = lambda x: color_func( c['DECORATED_NAME'])( @@ -1431,7 +1440,10 @@ def help(): 'stream': help_stream, } if g['stuff']: - d[g['stuff'].strip()]() + d.get( + g['stuff'].strip(), + lambda: printNicely(red('No such command.')) + )() else: printNicely(usage) @@ -1716,7 +1728,12 @@ def fly(): save_history() sys.exit() # Spawn stream thread - th = threading.Thread(target=stream, args=(c['USER_DOMAIN'], args, g['original_name'])) + th = threading.Thread( + target=stream, + args=( + c['USER_DOMAIN'], + args, + g['original_name'])) th.daemon = True th.start() # Start listen process diff --git a/setup.py b/setup.py index d225ebd..b9cf539 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '0.6.1' +version = '0.6.2' # Require install_requires = [ -- 2.25.1