🧑‍💻 Py scripts refinements

This commit is contained in:
Scott Lahteine
2025-10-07 02:26:49 -05:00
parent 0937fe55a4
commit 35da223f0a
8 changed files with 25 additions and 23 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ LANGHOME = "Marlin/src/lcd/language"
# Write multiple sheets if true, otherwise write one giant sheet
MULTISHEET = '--single' not in argv[1:]
OUTDIR = 'out-csv'
OUTDIR = Path('out-csv')
# Check for the path to the language files
if not Path(LANGHOME).is_dir():
@@ -125,10 +125,10 @@ if MULTISHEET:
#
# Export a separate sheet for each language
#
Path.mkdir(Path(OUTDIR), exist_ok=True)
OUTDIR.mkdir(exist_ok=True)
for lang in langcodes:
with open("%s/language_%s.csv" % (OUTDIR, lang), 'w', encoding='utf-8') as f:
with open(OUTDIR / f"language_{lang}.csv", 'w', encoding='utf-8') as f:
lname = lang + ' ' + namebyid(lang)
header = ['name', lname, lname + ' (wide)', lname + ' (tall)']
f.write('"' + '","'.join(header) + '"\n')