From 4c7f8f32fd13cb41680efe9b9d478fab23dacfa0 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 15 Feb 2019 20:45:39 -0500 Subject: show inkscape label in error messages --- lib/elements/element.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'lib/elements/element.py') 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) -- cgit v1.2.3