complete for Mac
authorOrakaro <nhatminh_179@hotmail.com>
Wed, 28 May 2014 14:31:43 +0000 (23:31 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Wed, 28 May 2014 14:31:43 +0000 (23:31 +0900)
rainbowstream/interactive.py
rainbowstream/rainbow.py

index e27c177..69efa54 100644 (file)
@@ -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
index dcb5e08..3ef13d4 100644 (file)
@@ -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,