+ return opts
+
+
+def server_test(io_db):
+ """Ensure valid server out file belonging to current process.
+
+ On failure, set io_db["kicked_by_rival"] and raise SystemExit.
+ """
+ if not os.access(io_db["path_out"], os.F_OK):
+ raise SystemExit("Server output file has disappeared.")
+ file = open(io_db["path_out"], "r")
+ test = file.readline().rstrip("\n")
+ file.close()
+ if test != io_db["teststring"]:
+ io_db["kicked_by_rival"] = True
+ msg = "Server test string in server output file does not match. This" \
+ " indicates that the current server process has been " \
+ "superseded by another one."
+ raise SystemExit(msg)
+
+
+def io_loop ():
+ return False
+
+
+io_db = {}
+world_db = {}
+try:
+ opts = parse_command_line_arguments()