Exemplo n.º 1
0
    def __init__(self,
                 locals=Environment.globals,
                 filename="<console>",
                 historyFile=HISTORY_FILE):

        code.InteractiveConsole.__init__(self, locals, filename)
        completer.Completer(locals)

        self.historyInitialisation(historyFile)

        self.addModule(history.History, locals)
Exemplo n.º 2
0
    def load_commands(self, commands):
        self.commands = commands
        self.comp = completer.Completer({}, "entry")
        for name in commands:
            self.comp.add_list(name)
            args = commands[name]
            for cmd in args:
                (cmdId, childs) = args[cmd]
                self.comp.add_to_list(name, {cmd: childs})

        readline.set_completer(self.comp.complete)
Exemplo n.º 3
0
 def __init__(self):
     self.conf = {
         "manga_location": "",
         "manga_name": "",
         "start_chapter": "",
         "end_chapter": ""
     }
     self.comp = completer.Completer()
     readline.set_completer_delims(' \t\n;')
     readline.parse_and_bind("tab:complete")
     readline.set_completer(self.comp.complete)
Exemplo n.º 4
0
    def __init__(self):

        aliases = usc_config.get_aliases()

        self.comp = completer.Completer({}, "entry")

        self.comp.add_list("entry", {})

        self.comp.add_to_list("entry", "list")
        self.comp.add_to_list("entry", {"drop":["alias"]})

        self.comp.add_to_list("entry", { "save":["alias"] })
        self.comp.add_to_list("entry", { "connect":["alias"], "quit":[] })

        self.comp.add_list("alias", set())
        for alias in aliases:
            self.comp.add_to_list("alias", { alias:[] } )

        self.refresh()
Exemplo n.º 5
0
    def __init__(self, prompt='>', intro=None):
        self.prompt = prompt
        self.intro = intro

        self.completer = completer.Completer()
        self.command_tree = command_tree.CommandTree()