diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-11-16 21:22:36 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2013-11-16 21:22:36 +0000 |
| commit | 8420f10fa1e70abe46a90978d28c16a6f3a8ea7b (patch) | |
| tree | 7902443eb1b06f8da5e3ff06db2090b392e96160 /share/extensions/plotter.py | |
| parent | fix error su_v tell to me (diff) | |
| parent | fix typo in rev 12797 (diff) | |
| download | inkscape-8420f10fa1e70abe46a90978d28c16a6f3a8ea7b.tar.gz inkscape-8420f10fa1e70abe46a90978d28c16a6f3a8ea7b.zip | |
fix error su_v tell to me
(bzr r12588.1.28)
Diffstat (limited to 'share/extensions/plotter.py')
| -rw-r--r-- | share/extensions/plotter.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 427e9401b..f57057435 100644 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -82,20 +82,12 @@ class MyEffect(inkex.Effect): ''' # 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'))) + self.options.docWidth = float(self.unittouu(self.document.getroot().get('width'))) + self.options.docHeight = float(self.unittouu(self.document.getroot().get('height'))) myHpglDecoder = hpgl_decoder.hpglDecoder(self.hpgl, self.options) - try: - doc, warnings = myHpglDecoder.getSvg() - # deliver document to inkscape - self.document = doc - except Exception as inst: - if inst.args[0] == 'NO_HPGL_DATA': - # do nothing - pass - else: - type, value, traceback = sys.exc_info() - raise ValueError, ('', type, value), traceback + doc, warnings = myHpglDecoder.getSvg() + # deliver document to inkscape + self.document = doc ''' if self.options.commandLanguage == 'dmpl': # convert HPGL to DMPL @@ -108,6 +100,7 @@ class MyEffect(inkex.Effect): mySerial = serial.Serial() mySerial.port = self.options.serialPort mySerial.baudrate = self.options.serialBaudRate + mySerial.timeout = 0.1 if self.options.flowControl == 'xonxoff': mySerial.xonxoff = True if self.options.flowControl == 'rtscts' or self.options.flowControl == 'dsrdtrrtscts': @@ -124,6 +117,7 @@ class MyEffect(inkex.Effect): type, value, traceback = sys.exc_info() raise ValueError, ('', type, value), traceback mySerial.write(self.hpgl) + mySerial.read(2) mySerial.close() if __name__ == '__main__': |
