Compare commits

...

3 Commits

Author SHA1 Message Date
bed153b5f8 Merge branch 'main' of git.wilw.dev:wilw/treadl
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2024-12-20 10:38:39 +00:00
a1d05684ed rename references of shaft in Treadling WIF parsing to use treadling 2024-12-19 22:36:05 +00:00
5f903d61b1 Fix issue in loading "empty" threads from WIF 2024-12-19 20:18:59 +00:00

View File

@ -224,10 +224,10 @@ def loads(wif_file):
draft["warp"]["defaultColour"] = draft["colours"][0]
for x in threading:
shaft = threading[x]
shaft = threading[x].strip()
if "," in shaft:
shaft = shaft.split(",")[0]
shaft = int(shaft)
shaft = int(shaft) if shaft else 0
while int(x) >= len(draft["warp"]["threading"]) - 1:
draft["warp"]["threading"].append({"shaft": 0})
draft["warp"]["threading"][int(x) - 1] = {"shaft": shaft}