fix(ruff): update Python code to conform to 0.16

This commit is contained in:
Jonathan Steffan
2026-07-24 21:14:49 +02:00
committed by xytovl
parent 8b54ba1643
commit 00d2727049
11 changed files with 465 additions and 396 deletions
+10 -9
View File
@@ -1,25 +1,26 @@
#!/usr/bin/env python3
import sys
import os.path
import sys
print(
"""// Generated file, do not edit
"""// Generated file, do not edit
#include <map>
#include <string>
#include <vector>
std::map<std::string, std::vector<int>> glyph_set_per_language = {""")
std::map<std::string, std::vector<int>> glyph_set_per_language = {"""
)
for po_file in sys.argv[1:]:
lang = os.path.basename(os.path.dirname(po_file))
lang = os.path.basename(os.path.dirname(po_file))
with open(po_file) as f:
charset = sorted(set(f.read()))
with open(po_file) as f:
charset = sorted(set(f.read()))
# Basic Latin and Latin-1 Supplement are always included
charset = ', '.join([str(ord(c)) for c in charset if ord(c) > 255])
# Basic Latin and Latin-1 Supplement are always included
charset = ", ".join([str(ord(c)) for c in charset if ord(c) > 255])
print("\t{{ \"{}\", {{{}}}}},".format(lang, charset))
print(f'\t{{ "{lang}", {{{charset}}}}},')
print("};")