Skip to content

Commit 0603a9d

Browse files
committed
GenericWriter: Create scheme for dynamic variable value creation
1 parent 05cce93 commit 0603a9d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
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()

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)