diff options
Diffstat (limited to 'lib/stitch_plan/stitch_plan.py')
| -rw-r--r-- | lib/stitch_plan/stitch_plan.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index 74caa54a..4593781a 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -3,9 +3,14 @@ # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. -from .ties import add_ties -from .color_block import ColorBlock +from sys import exit + +from inkex import errormsg + +from ..i18n import _ from ..svg import PIXELS_PER_MM +from .color_block import ColorBlock +from .ties import add_ties def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, disable_ties=False): # noqa: C901 @@ -17,6 +22,11 @@ def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, disable_ties= * adds jump-stitches between stitch_group if necessary """ + if not stitch_groups: + errormsg(_("There is no selected stitchable element. Please run " + "Extensions > Ink/Stitch > Troubleshoot > Troubleshoot objects in case you have expected a stitchout.")) + exit(1) + if collapse_len is None: collapse_len = 3.0 collapse_len = collapse_len * PIXELS_PER_MM |
