diff options
| author | Sebastian Wüst <sebi@timewaster.de> | 2013-07-14 13:08:21 +0000 |
|---|---|---|
| committer | Sebastian Wüst <sebi@timewaster.de> | 2013-07-14 13:08:21 +0000 |
| commit | 9c2812df7879eadc3d6743555b7d0a808d9ad9d7 (patch) | |
| tree | 0381e5d212bbbe8a386ea003064a4b37370806fb | |
| parent | moved main hpgl processing to new classes, moved plotter control to a extensi... (diff) | |
| download | inkscape-9c2812df7879eadc3d6743555b7d0a808d9ad9d7.tar.gz inkscape-9c2812df7879eadc3d6743555b7d0a808d9ad9d7.zip | |
minor changes
(bzr r12417.1.2)
| -rw-r--r-- | share/extensions/hpgl_encoder.py | 2 | ||||
| -rw-r--r-- | share/extensions/hpgl_input.py | 15 | ||||
| -rw-r--r-- | share/extensions/plotter.py | 18 |
3 files changed, 18 insertions, 17 deletions
diff --git a/share/extensions/hpgl_encoder.py b/share/extensions/hpgl_encoder.py index f6eef630c..58b1f79ea 100644 --- a/share/extensions/hpgl_encoder.py +++ b/share/extensions/hpgl_encoder.py @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA '''
# standard library
-import math, string,
+import math, string
# local library
import bezmisc, cspsubdiv, cubicsuperpath, inkex, simplestyle, simpletransform
diff --git a/share/extensions/hpgl_input.py b/share/extensions/hpgl_input.py index 2620c74dd..8290cf0a7 100644 --- a/share/extensions/hpgl_input.py +++ b/share/extensions/hpgl_input.py @@ -50,13 +50,12 @@ myHpglDecoder = hpgl_decoder.hpglDecoder(options) # issue warning if no hpgl data found if hasNoHpglData: inkex.errormsg(_("No HPGL data found.")) - doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" width="%s" height="%s"></svg>' % (options.docWidth, options.docHeight))) - -# issue warning if unknown commands where found -if hasUnknownCommands: - 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) + print 1 +else: + # issue warning if unknown commands where found + if hasUnknownCommands: + 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 diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 7b760e33e..f17c7dcf0 100644 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -66,7 +66,8 @@ class MyEffect(inkex.Effect): inkex.errormsg(_("No paths where found. Please convert all objects you want to plot into paths.")) return # 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. - if 1 == 2: # reparse data for preview + ''' + # reparse data for preview self.options.showMovements = True self.options.docWidth = float(inkex.unittouu(self.document.getroot().get('width'))) self.options.docHeight = float(inkex.unittouu(self.document.getroot().get('height'))) @@ -74,13 +75,14 @@ class MyEffect(inkex.Effect): (hasUnknownCommands, hasNoHpglData, doc) = myHpglDecoder.getSvg(self.hpgl) if not hasNoHpglData: self.document = doc - if 1 == 1: # send data to plotter - # TODO:2013-07-13:Sebastian Wüst:Somehow slow down sending to avoid buffer overruns in the plotter on very large drawings. - mySerial = serial.Serial(port=self.options.serialPort, baudrate=self.options.serialBaudRate, timeout=0.1, writeTimeout=None) - mySerial.write(self.hpgl) - # Read back 2 chars to avoid plotter not plotting last command (I have no idea why this is necessary) - mySerial.read(2) - mySerial.close() + ''' + # send data to plotter + # TODO:2013-07-13:Sebastian Wüst:Somehow slow down sending to avoid buffer overruns in the plotter on very large drawings. + mySerial = serial.Serial(port=self.options.serialPort, baudrate=self.options.serialBaudRate, timeout=0.1, writeTimeout=None) + mySerial.write(self.hpgl) + # Read back 2 chars to avoid plotter not plotting last command (I have no idea why this is necessary) + mySerial.read(2) + mySerial.close() if __name__ == '__main__': # Raise recursion limit to avoid exceptions on big documents |
