From: acspike Date: Sun, 1 Apr 2007 21:33:25 +0000 (+0000) Subject: throw out stderr so that users don't see the warning about no svg extension on temp... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d2ef6868b0ca327abfd5a6c54e8c8364af1636f8;p=inkscape.git throw out stderr so that users don't see the warning about no svg extension on temp files. yes, we will mask other errors --- diff --git a/share/extensions/perspective.py b/share/extensions/perspective.py index 2f25f6a54..014a7b779 100755 --- a/share/extensions/perspective.py +++ b/share/extensions/perspective.py @@ -19,12 +19,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Perspective approach & math by Dmitry Platonov, shadowjack@mail.ru, 2006 """ import sys, inkex, os, re, simplepath, cubicsuperpath -from ffgeom import * +from ffgeom import * try: from numpy import * - from numpy.linalg import * -except: - inkex.debug("Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again.") + from numpy.linalg import * +except: + inkex.debug("Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again.") sys.exit() uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'pc':15.0} @@ -68,9 +68,10 @@ class Project(inkex.Effect): file = self.args[-1] id = self.options.ids[0] for query in q.keys(): - f = os.popen("inkscape --query-%s --query-id=%s %s" % (query,id,file)) + _,f,err = os.popen3("inkscape --query-%s --query-id=%s %s" % (query,id,file)) q[query] = float(f.read()) f.close() + err.close() sp = array([[q['x'], q['y']+q['height']],[q['x'], q['y']],[q['x']+q['width'], q['y']],[q['x']+q['width'], q['y']+q['height']]], dtype=float64) solmatrix = zeros((8,8), dtype=float64) @@ -81,7 +82,7 @@ class Project(inkex.Effect): solmatrix[i][2] = 1 solmatrix[i][6] = -dp[i][0]*sp[i][0] solmatrix[i][7] = -dp[i][0]*sp[i][1] - solmatrix[i+4][3] = sp[i][0] + solmatrix[i+4][3] = sp[i][0] solmatrix[i+4][4] = sp[i][1] solmatrix[i+4][5] = 1 solmatrix[i+4][6] = -dp[i][1]*sp[i][0]