Skip to content

Commit f3a7d05

Browse files
authored
feat: simplify unicodes_per_glyphset code (#4)
1 parent 9a1ca96 commit f3a7d05

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/esphome_glyphsets/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def unicodes_per_glyphset(glyphset_name: str) -> list[int]:
2222
nam_path = GLYPHSETS_NAM_PATH / f"{glyphset_name}.nam"
2323
if not nam_path.exists():
2424
return []
25-
character_set: set[int] = set()
26-
for line in nam_path.read_text().splitlines():
27-
unicode = line.partition(" ")[0]
28-
if unicode.startswith("0x"):
29-
character_set.add(int(unicode[2:], 16))
25+
character_set = {
26+
int(line.partition(" ")[0][2:], 16)
27+
for line in nam_path.read_text().splitlines()
28+
if line.startswith("0x")
29+
}
3030
return sorted(character_set)

0 commit comments

Comments
 (0)