X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=blobdiff_plain;f=qchess%2Fsrc%2Fmain.py;h=748a4592688d48ee0a85165a2e784242282ae39f;hp=cbc07f79db30d13c04de20ac2324e392c100f033;hb=a6d91c8bb286fa91f9e2a56b304043ff48154322;hpb=3decbfd61b59ee2611700e7fa96368e02f643d4d diff --git a/qchess/src/main.py b/qchess/src/main.py index cbc07f7..748a459 100644 --- a/qchess/src/main.py +++ b/qchess/src/main.py @@ -109,7 +109,9 @@ def main(argv): elif arg[1] == '-' and arg[2:] == "reveal": always_reveal_states = True elif (arg[1] == '-' and arg[2:] == "graphics"): - graphics_enabled = not graphics_enabled + graphics_enabled = True + elif (arg[1] == '-' and arg[2:] == "no-graphics"): + graphics_enabled = False elif (arg[1] == '-' and arg[2:].split("=")[0] == "file"): # Load game from file if len(arg[2:].split("=")) == 1: @@ -119,7 +121,7 @@ def main(argv): if f[0:7] == "http://": src_file = HttpReplay(f) else: - src_file = open(f.split(":")[0], "r", 0) + src_file = FileReplay(f.split(":")[0]) if len(f.split(":")) == 2: max_moves = int(f.split(":")[1]) @@ -270,6 +272,8 @@ def main(argv): if src_file != None and src_file != sys.stdin: src_file.close() + sys.stdout.write(game.final_result + "\n") + return error # This is how python does a main() function...