diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2021-03-04 18:40:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-04 18:40:53 +0100 |
| commit | e84a86d4ac0caf29d6074728376ff0a594243fec (patch) | |
| tree | 888c79ed0094ba2916a1d329861a85515959913c /lib/extensions/output.py | |
| parent | b39575a50191307b3b56eab6455626398eec6397 (diff) | |
Update for Inkscape 1.0 (#880)
* update for inkscape 1.0
* add about extension
* Build improvements for the inkscape1.0 branch (#985)
* zip: export real svg not stitch plan
* #411 and #726
* Tools for Font Creators (#1018)
* ignore very small holes in fills
* remove embroider (#1026)
* auto_fill: ignore shrink_or_grow if result is empty (#589)
* break apart: do not ignore small fills
Co-authored-by: Hagen Fritsch <rumpeltux-github@irgendwo.org>
Co-authored-by: Lex Neva <github.com@lexneva.name>
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 |
