simple sgf output
[imago.git] / imago_pack / imago.py
index c0e6202..e2c2876 100755 (executable)
@@ -35,6 +35,8 @@ def argument_parser():
                         help="save images instead of displaying them")
     parser.add_argument('-c', '--cache', dest='l_cache', action='store_true',
                         help="use cached lines")
+    parser.add_argument('-S', '--sgf', dest='sgf_output', action='store_true',
+                        help="output in SGF")
     parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
                         help="report progress")
     return parser
@@ -101,11 +103,14 @@ def main():
 
     board = intrsc.board(image, lines, show_all, do_something)
 
-    #simple ASCII output:
-    for line in board:
-        print ' '.join(line)
+    if len(args.files) == 1:
+
+        if args.sgf_output:
+            print board.asSGFsetPos()
+        else:
+            print board
     
-    if len(args.files) > 1:
+    else:
         for f in args.files[1:]:
             try:
                 image = Image.open(f)