Initial commit

This commit is contained in:
hyyz17200
2026-04-28 14:39:54 +08:00
commit fd29e955e5
22 changed files with 3313 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
from __future__ import annotations
import re
import zipfile
GCODE_MEMBER_RE = re.compile(r"^Metadata/plate_(\d+)\.gcode$")
MD5_MEMBER_RE = re.compile(r"^Metadata/plate_(\d+)\.gcode\.md5$")
def list_gcode_members(archive: zipfile.ZipFile) -> list[str]:
members: list[tuple[int, str]] = []
for name in archive.namelist():
match = GCODE_MEMBER_RE.match(name)
if match:
members.append((int(match.group(1)), name))
return [name for _, name in sorted(members)]