diff options
| author | Lex Neva <github.com@lexneva.name> | 2019-02-15 20:45:39 -0500 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2019-02-16 16:53:38 -0500 |
| commit | 4c7f8f32fd13cb41680efe9b9d478fab23dacfa0 (patch) | |
| tree | 95f2668bf1862f6a866553201bb7556c467d1475 /lib/elements/element.py | |
| parent | 754c2aa63af84a25efc401e8f364deb660361e98 (diff) | |
show inkscape label in error messages
Diffstat (limited to 'lib/elements/element.py')
| -rw-r--r-- | lib/elements/element.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py index d9867351..10b1852a 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -1,15 +1,15 @@ -import sys from copy import deepcopy +import sys + +from cspsubdiv import cspsubdiv +import cubicsuperpath +import simplestyle +from ..commands import find_commands from ..i18n import _ -from ..utils import cache from ..svg import PIXELS_PER_MM, convert_length, get_doc_size, apply_transforms -from ..commands import find_commands - -# inkscape-provided utilities -import simplestyle -import cubicsuperpath -from cspsubdiv import cspsubdiv +from ..svg.tags import INKSCAPE_LABEL +from ..utils import cache class Patch: @@ -274,7 +274,14 @@ class EmbroideryElement(object): return patches def fatal(self, message): - # L10N used when showing an error message to the user such as "satin column: One or more of the rungs doesn't - # intersect both rails." - print >> sys.stderr, self.node.get("id") + ":", _("error:"), message.encode("UTF-8") + label = self.node.get(INKSCAPE_LABEL) + id = self.node.get("id") + if label: + name = "%s (%s)" % (label, id) + else: + name = id + + # L10N used when showing an error message to the user such as + # "Some Path (path1234): error: satin column: One or more of the rungs doesn't intersect both rails." + print >> sys.stderr, "%s: %s %s" % (name, _("error:"), message.encode("UTF-8")) sys.exit(1) |
