Skip to content

Commit

Permalink
Merge pull request #145 from EmbroidePy/generic-writer
Browse files Browse the repository at this point in the history
Generic writer: Dynamic Segment
  • Loading branch information
tatarize authored Apr 24, 2022
2 parents a7aea4e + d47bcff commit e8bede8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pyembroidery/GenericWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ def write(self):

# MAIN CODE, there is something to write.
if write_segment is not None:
if isinstance(write_segment, dict):
key, default = write_segment[None]
key = key.format_map(self.format_dictionary)
write_segment = write_segment.get(key,default)
self.update_positions(self.x, self.y, self.cmd)
if self.cmd == SEQUIN_MODE:
self.open_document()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyembroidery",
version="1.4.34",
version="1.4.35",
author="Tatarize",
author_email="[email protected]",
description="Embroidery IO library",
Expand Down
1 change: 0 additions & 1 deletion test/pattern_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def get_long_jump():
return pattern



def get_simple_pattern():
pattern = EmbPattern()
pattern.add_block([(0, 0), (0, 100), (100, 100), (100, 0), (0, 0)], "red")
Expand Down

0 comments on commit e8bede8

Please sign in to comment.