From b69c831773b99b08252411f1a6ab5cf4a482c0cc Mon Sep 17 00:00:00 2001 From: Maren Hachmann Date: Wed, 7 Feb 2018 22:17:10 +0000 Subject: Copy numpy import error message over from measure.py (no new strings) --- share/extensions/gcodetools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/extensions/gcodetools.py b/share/extensions/gcodetools.py index 1f0001c3a..be471136e 100755 --- a/share/extensions/gcodetools.py +++ b/share/extensions/gcodetools.py @@ -78,7 +78,6 @@ import copy import sys import time import cmath -import numpy import codecs import random # local library @@ -93,6 +92,12 @@ import bezmisc if "errormsg" not in dir(inkex): inkex.errormsg = lambda msg: sys.stderr.write((unicode(msg) + "\n").encode("UTF-8")) +try: + import numpy +except: + inkex.errormsg(_("Failed to import the numpy modules. These modules are required by this extension. Please install them and try again. On a Debian-like system this can be done with the command, sudo apt-get install python-numpy.")) + exit() + def bezierslopeatt(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)),t): ax,ay,bx,by,cx,cy,x0,y0=bezmisc.bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3))) -- cgit v1.2.3