Beispiel #1
0
def main():
    readline.parse_and_bind("tab: complete")
    readline.set_completer(home_completer)
    while True:
        try:
            prompt = input('\x1b[1m\x1b[37mPyIris (Home) > \x1b[0m').strip()
            command = prompt.split(' ', 1)[0].lower()
            if command == 'add':
                add.main(prompt)
            elif command == 'clear':
                clear.main()
            elif command == 'generator':
                print(config.inf + 'Switching...')
                generator_interface.main()
                readline.parse_and_bind("tab: complete")
                readline.set_completer(home_completer)
            elif command in ('?', 'help'):
                help.main('home', prompt)
            elif command == 'listeners':
                print(config.inf + 'Switching...')
                listener_interface.main()
                readline.parse_and_bind("tab: complete")
                readline.set_completer(home_completer)
            elif command in ('!', 'local'):
                local.main(prompt)
            elif command == 'python':
                python.main()
            elif command == 'quit':
                quit.main()
            elif command == 'regen':
                regen.main()
            elif command == 'reset':
                reset.main(prompt)
            elif command == 'rm':
                rm.main(prompt)
            elif command == 'scouts':
                print(config.inf + 'Switching...')
                scout_interface.main()
                readline.parse_and_bind("tab: complete")
                readline.set_completer(home_completer)
            elif command == 'show':
                show.main(prompt)
            elif not command:
                pass
            else:
                print(config.neg + 'Invalid command, run "help" for help menu')
        except EOFError:
            try:
                time.sleep(2)
            except KeyboardInterrupt:
                quit.main()
        except KeyboardInterrupt:
            quit.main()
Beispiel #2
0
def main():
    while True:
        try:
            prompt = raw_input('PyIris (Home) > ').strip()
            command = prompt.split(' ', 1)[0]
            if command == 'add':
                add.main(prompt)
            elif command == 'clear':
                clear.main()
            elif command == 'generator':
                print '[*]Switching...'
                generator_interface.main()
            elif command in ('?', 'help'):
                help.main('home', prompt)
            elif command == 'listeners':
                print '[*]Switching...'
                listener_interface.main()
            elif command in ('!', 'local'):
                local.main(prompt)
            elif command == 'python':
                python.main()
            elif command == 'quit':
                quit.main()
            elif command == 'regen':
                regen.main()
            elif command == 'reset':
                reset.main(prompt)
            elif command == 'rm':
                rm.main(prompt)
            elif command == 'scouts':
                print '[*]Switching...'
                scout_interface.main()
            elif command == 'show':
                show.main(prompt)
            elif not command:
                pass
            else:
                print '[-]Invalid command, run "help" for help menu'
        except EOFError:
            try:
                time.sleep(2)
            except KeyboardInterrupt:
                quit.main()
        except KeyboardInterrupt:
            quit.main()