def main(): readline.parse_and_bind("tab: complete") readline.set_completer(scout_completer) while True: try: prompt = input( '\x1b[1m\x1b[37mPyIris (\x1b[0m' + '\x1b[1m\x1b[31mScouts\x1b[0m' + '\x1b[1m\x1b[37m) > \x1b[0m').strip() command = prompt.split(' ', 1)[0].lower() if command == 'back': print(config.inf + 'Returning...') return elif command == 'bridge': stat = direct_interface.main(prompt) if stat == 'home': return readline.parse_and_bind("tab: complete") readline.set_completer(scout_completer) elif command == 'clear': clear.main() elif command == 'disconnect': disconnect.main(prompt) elif command in ('?', 'help'): help.main('scout', prompt) elif command == 'kill': kill.main(prompt) elif command in ('!', 'local'): local.main(prompt) elif command == 'rename': rename.main(prompt) elif command == 'sleep': sleep.main(prompt) elif command == 'ping': ping.main(prompt) elif command == 'python': python.main() elif command == 'quit': quit.main() elif command == 'show': show.main(prompt) elif command == 'more': more.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()
def main(): while True: try: prompt = raw_input('PyIris (Scouts) > ').strip() command = prompt.split(' ',1)[0].lower() if command == 'back': print '[*]Returning...' return elif command == 'bridge': stat = direct_interface.main(prompt) if stat == 'home': return elif command == 'clear': clear.main() elif command == 'disconnect': disconnect.main(prompt) elif command in ('?','help'): help.main('scout',prompt) elif command == 'kill': kill.main(prompt) elif command in ('!','local'): local.main(prompt) elif command == 'rename': rename.main(prompt) elif command == 'sleep': sleep.main(prompt) elif command == 'ping': ping.main(prompt) elif command == 'python': python.main() elif command == 'quit': quit.main() elif command == 'show': show.main(prompt) elif command == 'more': more.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()