summaryrefslogtreecommitdiffstats
path: root/share/extensions/plotter.py
diff options
context:
space:
mode:
authorSebastian Wüst <sebi@timewaster.de>2013-07-14 17:44:08 +0000
committerSebastian Wüst <sebi@timewaster.de>2013-07-14 17:44:08 +0000
commit7108556bbdc57d1d6ea3c5002c6b475667cea4f2 (patch)
treeed0acc8d2279f1bb4401b5723485c1f74f81b236 /share/extensions/plotter.py
parentload whole file instead of one line. (diff)
downloadinkscape-7108556bbdc57d1d6ea3c5002c6b475667cea4f2.tar.gz
inkscape-7108556bbdc57d1d6ea3c5002c6b475667cea4f2.zip
changed how encoder passes errors
(bzr r12417.1.5)
Diffstat (limited to 'share/extensions/plotter.py')
-rw-r--r--share/extensions/plotter.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py
index d54f9ed6c..ebb69e8a1 100644
--- a/share/extensions/plotter.py
+++ b/share/extensions/plotter.py
@@ -53,7 +53,6 @@ class MyEffect(inkex.Effect):
try:
import serial
except ImportError, e:
- # TODO:2013-07-13:Sebastian Wüst:Maybe add this text to extension window
inkex.errormsg(_("pySerial is not installed."
+ "\n\n1. Download pySerial here: http://pypi.python.org/pypi/pyserial"
+ "\n2. Extract the \"serial\" subfolder from the zip to the following folder: \"C:\\Program Files (x86)\\inkscape\\python\\Lib\\\" (Or wherever your Inkscape is installed to)"
@@ -61,10 +60,15 @@ class MyEffect(inkex.Effect):
return
# get hpgl data
myHpglEncoder = hpgl_encoder.hpglEncoder(self.document.getroot(), self.options)
- self.hpgl = myHpglEncoder.getHpgl()
- if self.hpgl == -1:
- inkex.errormsg(_("No paths where found. Please convert all objects you want to plot into paths."))
- return
+ try:
+ self.hpgl = myHpglEncoder.getHpgl()
+ except Exception as inst:
+ if inst.args[0] == 'NO_PATHS':
+ # issue error if no paths found
+ inkex.errormsg(_("No paths where found. Please convert all objects you want to plot into paths."))
+ return 1
+ else:
+ raise Exception(inst)
# TODO:2013-07-13:Sebastian Wüst:Get preview to work. This requires some work on the C++ side to be able to determine if it is a preview or a final run.
'''
# reparse data for preview