Skip to content

Commit e8bede8

Browse files
authored
Merge pull request #145 from EmbroidePy/generic-writer
Generic writer: Dynamic Segment
2 parents a7aea4e + d47bcff commit e8bede8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

pyembroidery/GenericWriter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ def write(self):
459459

460460
# MAIN CODE, there is something to write.
461461
if write_segment is not None:
462+
if isinstance(write_segment, dict):
463+
key, default = write_segment[None]
464+
key = key.format_map(self.format_dictionary)
465+
write_segment = write_segment.get(key,default)
462466
self.update_positions(self.x, self.y, self.cmd)
463467
if self.cmd == SEQUIN_MODE:
464468
self.open_document()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="pyembroidery",
8-
version="1.4.34",
8+
version="1.4.35",
99
author="Tatarize",
1010
author_email="[email protected]",
1111
description="Embroidery IO library",

test/pattern_for_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ def get_long_jump():
211211
return pattern
212212

213213

214-
215214
def get_simple_pattern():
216215
pattern = EmbPattern()
217216
pattern.add_block([(0, 0), (0, 100), (100, 100), (100, 0), (0, 0)], "red")

0 commit comments

Comments
 (0)