diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-02-16 22:58:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-16 22:58:10 -0500 |
| commit | 7aee0979be4f39cde7a6396cdc0d1d2cc4222d90 (patch) | |
| tree | 1123050a6ba7428dbcc8b72bd074161bdb3e014f /lib/extensions | |
| parent | 30c73dc39c1ac814d0c63ec102c7f8c2b993fdd0 (diff) | |
| parent | f6c2aa89197c82cedfb31465fc4b2acffaeb8f25 (diff) | |
Merge pull request #2045 from inkstitch/lexelby/interruptible-threads
make simulator threads interruptible
Diffstat (limited to 'lib/extensions')
| -rw-r--r-- | lib/extensions/lettering.py | 3 | ||||
| -rw-r--r-- | lib/extensions/params.py | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/extensions/lettering.py b/lib/extensions/lettering.py index 0d18449a..c997e201 100644 --- a/lib/extensions/lettering.py +++ b/lib/extensions/lettering.py @@ -24,6 +24,7 @@ from ..svg.tags import (INKSCAPE_LABEL, INKSTITCH_LETTERING, SVG_GROUP_TAG, from ..utils import DotDict, cache, get_bundled_dir, get_resource_dir from .commands import CommandsExtension from .lettering_custom_font_dir import get_custom_font_dir +from ..utils.threading import ExitThread class LetteringFrame(wx.Frame): @@ -344,6 +345,8 @@ class LetteringFrame(wx.Frame): patches.extend(element.embroider(None)) except SystemExit: raise + except ExitThread: + raise except Exception: raise # Ignore errors. This can be things like incorrect paths for diff --git a/lib/extensions/params.py b/lib/extensions/params.py index 306e5e56..1262ceb6 100644 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -25,6 +25,7 @@ from ..i18n import _ from ..svg.tags import SVG_POLYLINE_TAG from ..utils import get_resource_dir from .base import InkstitchExtension +from ..utils.threading import ExitThread, check_stop_flag def grouper(iterable_obj, count, fillvalue=None): @@ -509,9 +510,13 @@ class SettingsFrame(wx.Frame): # for many params in embroider.py. patches.extend(copy(node).embroider(None)) + + check_stop_flag() except SystemExit: wx.CallAfter(self._show_warning) raise + except ExitThread: + raise except Exception as e: # Ignore errors. This can be things like incorrect paths for # satins or division by zero caused by incorrect param values. |
