示例#1
0
def setup():
    """
    Install fancycompleter as the default completer for readline.
    """
    completer = Completer()
    readline = completer.config.readline
    if has_leopard_libedit(completer.config):
        readline.parse_and_bind("bind ^I rl_complete")
    else:
        readline.parse_and_bind('tab: complete')
    readline.set_completer(completer.complete)
    return completer
示例#2
0
def setup():
    """
    Install fancycompleter as the default completer for readline.
    """
    completer = Completer()
    readline = completer.config.readline
    if has_leopard_libedit(completer.config):
        readline.parse_and_bind("bind ^I rl_complete")
    else:
        readline.parse_and_bind('tab: complete')
    readline.set_completer(completer.complete)
    return completer
示例#3
0
 def __init__(self, namespace=None, Config=None):
     rlcompleter.Completer.__init__(self, namespace)
     self.config = self.get_config(Config)
     self.config.setup()
     readline = self.config.readline
     if hasattr(readline, '_setup'):
         # this is needed to offer pyrepl a better chance to patch
         # raw_input. Usually, it does at import time, but is we are under
         # pytest with output captured, at import time we don't have a
         # terminal and thus the raw_input hook is not installed
         readline._setup()
     if self.config.use_colors:
         readline.parse_and_bind('set dont-escape-ctrl-chars on')
     if self.config.consider_getitems:
         delims = readline.get_completer_delims()
         delims = delims.replace('[', '')
         delims = delims.replace(']', '')
         readline.set_completer_delims(delims)
示例#4
0
 def __init__(self, namespace = None, Config=None):
     rlcompleter.Completer.__init__(self, namespace)
     self.config = self.get_config(Config)
     self.config.setup()
     readline = self.config.readline
     if hasattr(readline, '_setup'):
         # this is needed to offer pyrepl a better chance to patch
         # raw_input. Usually, it does at import time, but is we are under
         # pytest with output captured, at import time we don't have a
         # terminal and thus the raw_input hook is not installed
         readline._setup()
     if self.config.use_colors:
         readline.parse_and_bind('set dont-escape-ctrl-chars on')
     if self.config.consider_getitems:
         delims = readline.get_completer_delims()
         delims = delims.replace('[', '')
         delims = delims.replace(']', '')
         readline.set_completer_delims(delims)