summaryrefslogtreecommitdiffstats
path: root/share/extensions/hpgl_input.py
diff options
context:
space:
mode:
authorSebastian Wüst <sebi@timewaster.de>2013-11-10 13:06:03 +0000
committerSebastian Wüst <sebi@timewaster.de>2013-11-10 13:06:03 +0000
commit297f45e2e4ab293f036a7199ec80f9c3008cdcb5 (patch)
treec33ab6983d609f23949eea4f54cd7dda55787a30 /share/extensions/hpgl_input.py
parentRevert unintentional change. (diff)
downloadinkscape-297f45e2e4ab293f036a7199ec80f9c3008cdcb5.tar.gz
inkscape-297f45e2e4ab293f036a7199ec80f9c3008cdcb5.zip
fixed and optimized pyserial usage, added dmpl support, small stuff
(bzr r12787)
Diffstat (limited to 'share/extensions/hpgl_input.py')
-rw-r--r--share/extensions/hpgl_input.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/share/extensions/hpgl_input.py b/share/extensions/hpgl_input.py
index d1d46c76f..93dd5a6c2 100644
--- a/share/extensions/hpgl_input.py
+++ b/share/extensions/hpgl_input.py
@@ -53,18 +53,20 @@ hpglString = ';'.join(hpglString)
myHpglDecoder = hpgl_decoder.hpglDecoder(hpglString, options)
try:
doc, warnings = myHpglDecoder.getSvg()
- # issue warning if unknown commands where found
- if 'UNKNOWN_COMMANDS' in warnings:
- inkex.errormsg(_("The HPGL data contained unknown (unsupported) commands, there is a possibility that the drawing is missing some content."))
- # deliver document to inkscape
- doc.write(inkex.sys.stdout)
except Exception as inst:
if inst.args[0] == 'NO_HPGL_DATA':
# issue error if no hpgl data found
inkex.errormsg(_("No HPGL data found."))
- print 1
+ exit(1)
else:
type, value, traceback = sys.exc_info()
raise ValueError, ("", type, value), traceback
+# issue warning if unknown commands where found
+if 'UNKNOWN_COMMANDS' in warnings:
+ inkex.errormsg(_("The HPGL data contained unknown (unsupported) commands, there is a possibility that the drawing is missing some content."))
+
+# deliver document to inkscape
+doc.write(inkex.sys.stdout)
+
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 \ No newline at end of file