]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/fen2ascii.py
Remove profiling.py
[lyx.git] / lib / scripts / fen2ascii.py
index 96bd6e0e1c93424e242ae33aabcd3e99e993740e..8a98bcbc92d5bd680dc1678289f7ee48c9019517 100644 (file)
@@ -1,5 +1,3 @@
-#! /usr/bin/env python
-
 # file fen2ascii.py
 # This file is part of LyX, the document processor.
 # Licence details can be found in the file COPYING.
@@ -15,7 +13,7 @@ import sys,string,os
 
 os.close(0)
 os.close(1)
-sys.stdin = open(sys.argv[1],"r")
+sys.stdin = open(sys.argv[1])
 sys.stdout = open(sys.argv[2],"w")
 
 line = sys.stdin.readline()
@@ -28,24 +26,23 @@ comp=string.split(line,'/')
 cont=1
 margin= " "*6
 
-print margin+'   +'+"-"*15+'+'
+print (margin+'   +'+"-"*15+'+')
 for i in range(8):
-
     cont = cont + 1
     tmp=""
     for j in comp[i]:
-       if j>='0' and j <= '9':
-           for k in range(int(j)):
-               cont = cont + 1
-               x, mod = divmod(cont,2)
-               if mod : tmp = tmp + '| '
-               else : tmp = tmp + '|*'
-       else :
-           tmp = tmp + '|' + j
-           cont = cont + 1
+        if j>='0' and j <= '9':
+            for k in range(int(j)):
+                cont = cont + 1
+                x, mod = divmod(cont,2)
+                if mod : tmp = tmp + '| '
+                else : tmp = tmp + '|*'
+        else :
+            tmp = tmp + '|' + j
+            cont = cont + 1
 
     row = 8 - i
-    print margin, row, tmp+"|"
+    print (margin, row, tmp+"|")
 
-print margin+'   +'+"-"*15+'+'
-print margin+'    a b c d e f g h '
+print (margin+'   +'+"-"*15+'+')
+print (margin+'    a b c d e f g h ')