diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-17 21:34:08 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-25 21:17:58 -0400 |
| commit | 40968365d4e8cbc271c654e008a31707add8a7e3 (patch) | |
| tree | 3452848f989ecffed30a18986716c7dfa9546262 /lib | |
| parent | 3cac91a1934de8d9a341f89e9f2fa2c4b7c41a29 (diff) | |
update output extension for pyembroidery
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/extensions/output.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/extensions/output.py b/lib/extensions/output.py index f4b153e6..1dc8d19d 100644 --- a/lib/extensions/output.py +++ b/lib/extensions/output.py @@ -29,20 +29,17 @@ class Output(InkstitchExtension): patches = self.elements_to_patches(self.elements) stitch_plan = patches_to_stitch_plan(patches, self.options.collapse_length_mm * PIXELS_PER_MM) - # libembroidery wants to write to an actual file rather than stdout temp_file = tempfile.NamedTemporaryFile(suffix=".%s" % self.options.file_extension, delete=False) # in windows, failure to close here will keep the file locked temp_file.close() - # libembroidery likes to debug log things to stdout. No way to disable it. - save_stdout() write_embroidery_file(temp_file.name, stitch_plan, self.document.getroot()) # inkscape will read the file contents from stdout and copy # to the destination file that the user chose with open(temp_file.name) as output_file: - sys.real_stdout.write(output_file.read()) + sys.stdout.write(output_file.read()) # clean up the temp file os.remove(temp_file.name) |
