summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2008-12-27 17:17:57 +0000
committeralvinpenner <alvinpenner@users.sourceforge.net>2008-12-27 17:17:57 +0000
commite1c8492075f39fb79f5a7dacebdda5eeaf4c0514 (patch)
treed451c7e6b119520881560faf5b86e475404e4a02 /share
parentallow first selected object to be a group (diff)
downloadinkscape-e1c8492075f39fb79f5a7dacebdda5eeaf4c0514.tar.gz
inkscape-e1c8492075f39fb79f5a7dacebdda5eeaf4c0514.zip
exit message if first object has a sodipodi:type
(bzr r7026)
Diffstat (limited to 'share')
-rwxr-xr-xshare/extensions/perspective.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/share/extensions/perspective.py b/share/extensions/perspective.py
index 862ea1504..456cde580 100755
--- a/share/extensions/perspective.py
+++ b/share/extensions/perspective.py
@@ -27,7 +27,7 @@ try:
from numpy.linalg import *
except:
inkex.errormsg(_("Failed to import the numpy or numpy.linalg 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."))
- sys.exit()
+ exit()
uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'pc':15.0}
def unittouu(string):
@@ -53,17 +53,20 @@ class Project(inkex.Effect):
def effect(self):
if len(self.options.ids) < 2:
inkex.errormsg(_("This extension requires two selected paths."))
- sys.exit()
+ exit()
#obj is selected second
obj = self.selected[self.options.ids[0]]
envelope = self.selected[self.options.ids[1]]
+ if obj.get(inkex.addNS('type','sodipodi')):
+ inkex.errormsg(_("The first selected object is of type '%s'.\nTry using the procedure Path | Object to Path." % obj.get(inkex.addNS('type','sodipodi'))))
+ exit()
if obj.tag == inkex.addNS('path','svg') or obj.tag == inkex.addNS('g','svg'):
if envelope.tag == inkex.addNS('path','svg'):
path = cubicsuperpath.parsePath(envelope.get('d'))
if len(path) < 1 or len(path[0]) < 4:
inkex.errormsg(_("This extension requires that the second selected path be four nodes long."))
- sys.exit()
+ exit()
dp = zeros((4,2), dtype=float64)
for i in range(4):
dp[i][0] = path[0][i][1][0]
@@ -84,10 +87,10 @@ class Project(inkex.Effect):
inkex.errormsg(_("The second selected object is a group, not a path.\nTry using the procedure Object | Ungroup."))
else:
inkex.errormsg(_("The second selected object is not a path.\nTry using the procedure Path | Object to Path."))
- sys.exit()
+ exit()
else:
inkex.errormsg(_("The first selected object is not a path.\nTry using the procedure Path | Object to Path."))
- sys.exit()
+ exit()
solmatrix = zeros((8,8), dtype=float64)
free_term = zeros((8), dtype=float64)