diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-09-12 21:32:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-12 21:32:15 -0400 |
| commit | 7b8af2ed5731bc10b331db2b32dbce48f60c33a9 (patch) | |
| tree | ac06f38cde84e676f8aa8e91f08b71d45b9f2642 /lib/output.py | |
| parent | 3fd741a1a4218b6559184aaadcde8abca178bde2 (diff) | |
| parent | d30507171b04f37871db74609c0a521325bddbd1 (diff) | |
Merge pull request #301 from inkstitch/lexelby/bug-fixes
bug fixes
Diffstat (limited to 'lib/output.py')
| -rw-r--r-- | lib/output.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/output.py b/lib/output.py index 147d084e..ed97ef04 100644 --- a/lib/output.py +++ b/lib/output.py @@ -1,6 +1,8 @@ +import sys import pyembroidery import simpletransform +from .i18n import _ from .utils import Point from .svg import PIXELS_PER_MM, get_doc_size, get_viewbox_transform from .commands import global_command @@ -92,4 +94,10 @@ def write_embroidery_file(file_path, stitch_plan, svg): settings['max_jump'] = float('inf') settings['explicit_trim'] = False - pyembroidery.write(pattern, file_path, settings) + try: + pyembroidery.write(pattern, file_path, settings) + except IOError as e: + # L10N low-level file error. %(error)s is (hopefully?) translated by + # the user's system automatically. + print >> sys.stderr, _("Error writing to %(path)s: %(error)s") % dict(path=file_path, error=e.message) + sys.exit(1) |
