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/elements/element.py | |
| parent | 3fd741a1a4218b6559184aaadcde8abca178bde2 (diff) | |
| parent | d30507171b04f37871db74609c0a521325bddbd1 (diff) | |
Merge pull request #301 from inkstitch/lexelby/bug-fixes
bug fixes
Diffstat (limited to 'lib/elements/element.py')
| -rw-r--r-- | lib/elements/element.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py index 4edb00c0..ec50ce22 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -197,7 +197,11 @@ class EmbroideryElement(object): # In a path, each element in the 3-tuple is itself a tuple of (x, y). # Tuples all the way down. Hasn't anyone heard of using classes? - return cubicsuperpath.parsePath(self.node.get("d")) + d = self.node.get("d", "") + if not d: + self.fatal(_("Object %(id)s has an empty 'd' attribute. Please delete this object from your document.") % dict(id=self.node.get("id"))) + + return cubicsuperpath.parsePath(d) @cache def parse_path(self): @@ -264,5 +268,7 @@ class EmbroideryElement(object): return patches def fatal(self, message): - print >> sys.stderr, "error:", 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 sys.exit(1) |
