diff options
Diffstat (limited to 'lib/extensions/output.py')
| -rw-r--r-- | lib/extensions/output.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/extensions/output.py b/lib/extensions/output.py index ccf4d7cb..52e9d3a9 100644 --- a/lib/extensions/output.py +++ b/lib/extensions/output.py @@ -11,7 +11,7 @@ class Output(InkstitchExtension): def __init__(self, *args, **kwargs): InkstitchExtension.__init__(self, *args, **kwargs) - def getoptions(self, args=sys.argv[1:]): + def parse_arguments(self, args=sys.argv[1:]): # inkex's option parsing can't handle arbitrary command line arguments # that may be passed for a given output format, so we'll just parse the # args ourselves. :P @@ -39,14 +39,16 @@ class Output(InkstitchExtension): self.file_extension = self.settings.pop('format') del sys.argv[1:] - InkstitchExtension.getoptions(self, extra_args) + InkstitchExtension.parse_arguments(self, extra_args) def effect(self): if not self.get_elements(): return + self.metadata = self.get_inkstitch_metadata() + collapse_len = self.metadata['collapse_len_mm'] patches = self.elements_to_patches(self.elements) - stitch_plan = patches_to_stitch_plan(patches, disable_ties=self.settings.get('laser_mode', False)) + stitch_plan = patches_to_stitch_plan(patches, collapse_len=collapse_len, disable_ties=self.settings.get('laser_mode', False)) temp_file = tempfile.NamedTemporaryFile(suffix=".%s" % self.file_extension, delete=False) @@ -62,7 +64,7 @@ class Output(InkstitchExtension): # inkscape will read the file contents from stdout and copy # to the destination file that the user chose with open(temp_file.name, "rb") as output_file: - sys.stdout.write(output_file.read()) + sys.stdout.buffer.write(output_file.read()) sys.stdout.flush() # clean up the temp file |
