Example #1
0
def main():
    print("Starting Savu Config tool (please wait for prompt)")

    comp = Completer()
    # we want to treat '/' as part of a word, so override the delimiters
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(comp.complete)

    # load all the packages in the plugins directory to register classes
    # I've changed this to be in plugin utils package since this is now also called from dawn when
    #it populates savu plugins. adp 14/12/16
    pu.populate_plugins()

    # set up things
    input_string = "startup"
    content = Content("")

    while True:
        input_string = raw_input(">>> ").strip()

        if len(input_string) == 0:
            command = 'help'
            arg = ""
        else:
            command = input_string.split()[0]
            arg = ' '.join(input_string.split()[1:])

        # try to run the command
        if command in commands.keys():
            content = commands[command](content, arg)
        else:
            print("I'm sorry, thats not a command I recognise, try help")

        if content.is_finished():
            break

        # write the history to the history file
        readline.write_history_file(histfile)

    print("Thanks for using the application")
Example #2
0
def _set_readline(completer):
    # we want to treat '/' as part of a word, so override the delimiters
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(completer)
Example #3
0
def _set_readline(completer):
    # we want to treat '/' as part of a word, so override the delimiters
    readline.set_completer_delims(' \t\n;')
    readline.parse_and_bind("tab: complete")
    readline.set_completer(completer)