def app_main(): action = sys.argv[1] if sys.argv[1:] else None if action == 'load': savename = sys.argv[2] save.load_game(savename) elif action == 'connect': host, port, username = sys.argv[2:] save.connect(host, int(port), username) elif action == 'eval': exec sys.argv[2] in globals() elif action == 'loadmeet': savename = sys.argv[2] ident = int(sys.argv[3]) def callback(): client.freeciv.func.py_init_meeting(ident) save.load_game(savename, callback) elif action == 'help': import help help.show() else: if action: print 'unknown action %r, see lib/main.py for actions' % action menus.main_menu()
def app_main(): action = sys.argv[1] if sys.argv[1:] else None if action == "load": savename = sys.argv[2] save.load_game(savename) elif action == "connect": host, port, username = sys.argv[2:] save.connect(host, int(port), username) elif action == "eval": exec sys.argv[2] in globals() elif action == "loadmeet": savename = sys.argv[2] ident = int(sys.argv[3]) def callback(): client.freeciv.func.py_init_meeting(ident) save.load_game(savename, callback) elif action == "help": import help help.show() else: if action: print "unknown action %r, see lib/main.py for actions" % action menus.main_menu()
def client_main(): action = sys.argv[1] if sys.argv[1:] else None if try_resume(): ui.main() return if action == 'load': savename = sys.argv[2] save.load_game(savename) elif action == 'connect': host, port = sys.argv[2:] save.connect(host, int(port)) else: show_main_menu() if features.get('app.profile'): profile_main() else: ui.main()