commit bfacecbee3169854bd5821af1aafef982230796b
Author: José Matos <[email protected]>
Date: Thu Jul 17 19:56:59 2025 +0100
Whitespace and format changes only
Use ruff to format and check the code.
The code has not changed. This is a preparation stage for other changes.
---
lib/scripts/fen2ascii.py | 40 ++++++++++++++++++++++------------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/lib/scripts/fen2ascii.py b/lib/scripts/fen2ascii.py
index 8a98bcbc92..2564a58e27 100644
--- a/lib/scripts/fen2ascii.py
+++ b/lib/scripts/fen2ascii.py
@@ -9,40 +9,44 @@
# This script will convert a chess position in the FEN
# format to an ascii representation of the position.
-import sys,string,os
+import os
+import string
+import sys
os.close(0)
os.close(1)
sys.stdin = open(sys.argv[1])
-sys.stdout = open(sys.argv[2],"w")
+sys.stdout = open(sys.argv[2], "w")
line = sys.stdin.readline()
-if line[-1] == '\n':
+if line[-1] == "\n":
line = line[:-1]
-line=string.split(line,' ')[0]
-comp=string.split(line,'/')
+line = string.split(line, " ")[0]
+comp = string.split(line, "/")
-cont=1
-margin= " "*6
+cont = 1
+margin = " " * 6
-print (margin+' +'+"-"*15+'+')
+print(margin + " +" + "-" * 15 + "+")
for i in range(8):
cont = cont + 1
- tmp=""
+ tmp = ""
for j in comp[i]:
- if j>='0' and j <= '9':
+ 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
+ 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 ")
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs