X-Git-Url: http://git.tomasm.cz/imago.git/blobdiff_plain/eb3c787367efefbba1ddf077d3a589468b77d2d1..801adea375f57a51cf6dd23cd4cda496cfc47bfd:/imago_pack/imago.py?ds=sidebyside diff --git a/imago_pack/imago.py b/imago_pack/imago.py index e2c2876..7c6c1f2 100755 --- a/imago_pack/imago.py +++ b/imago_pack/imago.py @@ -18,6 +18,7 @@ import linef import manual import intrsc import gridf +import output def argument_parser(): parser = argparse.ArgumentParser(description=__doc__) @@ -111,17 +112,25 @@ def main(): print board else: + game = output.Game(19, board) #TODO size parameter for f in args.files[1:]: try: image = Image.open(f) except IOError, msg: print >> sys.stderr, msg continue + if verbose: + print >> sys.stderr, "Opening", f if image.mode == 'P': image = image.convert('RGB') board = intrsc.board(image, lines, show_all, do_something) - for line in board: - print ' '.join(line) + if args.sgf_output: + game.addMove(board) + else: + print board + + if args.sgf_output: + print game.asSGF() return 0 @@ -144,5 +153,5 @@ if __name__ == '__main__': try: sys.exit(main()) except KeyboardInterrupt: #TODO does this work? - print "Interrupted." + print >> sys.stderr, "Interrupted." sys.exit(1)