From 4ac5fe728569c93edad120f0259c16309197f3c9 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Wed, 28 May 2014 23:31:43 +0900 Subject: [PATCH] complete for Mac --- rainbowstream/interactive.py | 7 +++++-- rainbowstream/rainbow.py | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rainbowstream/interactive.py b/rainbowstream/interactive.py index e27c177..69efa54 100644 --- a/rainbowstream/interactive.py +++ b/rainbowstream/interactive.py @@ -1,5 +1,5 @@ import readline - +import rlcompleter class RainbowCompleter(object): @@ -35,5 +35,8 @@ def init_interactive_shell(set): Init the rainbow shell """ readline.set_completer(RainbowCompleter(set).complete) - readline.parse_and_bind('tab: complete') readline.parse_and_bind('set editing-mode vi') + if 'libedit' in readline.__doc__: + readline.parse_and_bind("bind ^I rl_complete") + else: + readline.parse_and_bind("tab: complete") \ No newline at end of file diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index dcb5e08..3ef13d4 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -56,6 +56,7 @@ def draw(t, keyword=None): date = date - datetime.timedelta(seconds=time.timezone) clock = date.strftime('%Y/%m/%d %H:%M:%S') + print('before search') res = db.tweet_query(tid) if not res: db.store(tid) @@ -383,8 +384,6 @@ def stream(): # The Logo ascii_art() - g['stuff'] = '1' - home() # These arguments are optional: stream_args = dict( timeout=args.timeout, -- 2.25.1