refactor(kde): add type hints to Python build scripts

- Annotate functions in fastfetch, spectacle and theme scripts
- Add Color and ColorFn type aliases in theme/build.py
- Annotate empty collections and silence optionxform assignment errors
This commit is contained in:
tri committed 2026-11-02 15:17:49 +07:00
1 parent 34e978e84c
commit 3d1011e17c
3 files changed
+49 -41

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ COLS, ROWS = 20, 10
KONSOLE_CELL = 8, 17
def encode(png, dst):
def encode(png: bytes, dst: Path) -> None:
data = base64.b64encode(png)
chunks = [data[i : i + 4096] for i in range(0, len(data), 4096)]
out = bytearray()
@@ -44,7 +44,7 @@ def encode(png, dst):
dst.write_bytes(out)
def resize(width, height):
def resize(width: int, height: int) -> bytes:
with tempfile.TemporaryDirectory() as tmp:
out = Path(tmp) / "out.png"
subprocess.run(