def StartServer(): """Starts server on the config port.""" portable_server.main()
sys.argv[0]) # Cannot use os.fork for this purpose, as that is not available in windows if sys.argv[1] == 'run_in_background': # Run this job in background new_list = sys.argv new_list.pop(1) # remove the run_in_background parameter if os.path.abspath(sys.executable) != os.path.abspath(sys.argv[0]): # running with interpreter, so add interpreter new_list.insert(0, sys.executable) subprocess.Popen(new_list) sys.exit(0) first_argument = sys.argv[1] sys.argv.pop(1) if first_argument == 'server': import portable_server portable_server.main() elif first_argument == 'select': import globe_selector globe_selector.main(sys.argv) # The following are for installer elif first_argument == 'get_yes_no': import get_yes_no get_yes_no.main(sys.argv) elif first_argument == 'creatshortcut': import creatshortcut creatshortcut.main() elif first_argument == 'get_user_dir_choice': import get_user_dir_choice get_user_dir_choice.main() elif first_argument == 'check_server_running': import check_server_running