diff options
| author | Sebastian Wüst <sebi@timewaster.de> | 2013-12-26 19:37:25 +0000 |
|---|---|---|
| committer | Sebastian Wüst <sebi@timewaster.de> | 2013-12-26 19:37:25 +0000 |
| commit | f785f4db5317ef8b0e7d5b425dcf1936d6b57815 (patch) | |
| tree | 3fafa49607c001f08245b1ae301827f1fb1662c1 | |
| parent | fixed positioning bug (diff) | |
| download | inkscape-f785f4db5317ef8b0e7d5b425dcf1936d6b57815.tar.gz inkscape-f785f4db5317ef8b0e7d5b425dcf1936d6b57815.zip | |
fixed bug serial missing
(bzr r12860)
| -rw-r--r-- | share/extensions/hpgl_encoder.py | 12 | ||||
| -rw-r--r-- | share/extensions/plotter.py | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/share/extensions/hpgl_encoder.py b/share/extensions/hpgl_encoder.py index 31aa73501..98993cd79 100644 --- a/share/extensions/hpgl_encoder.py +++ b/share/extensions/hpgl_encoder.py @@ -208,17 +208,17 @@ class hpglEncoder: def processPath(self, node, mat): # process path - paths = node.get('d') - if paths: + path = node.get('d') + if path: # parse and transform path - paths = cubicsuperpath.parsePath(paths) - simpletransform.applyTransformToPath(mat, paths) - cspsubdiv.cspsubdiv(paths, self.flat) + path = cubicsuperpath.parsePath(path) + simpletransform.applyTransformToPath(mat, path) + cspsubdiv.cspsubdiv(path, self.flat) # path to HPGL commands oldPosX = 0.0 oldPosY = 0.0 # TODO: Plot smallest parts first to avid plotter dragging parts of foil around (on text) - for singlePath in paths: + for singlePath in path: cmd = 'PU' for singlePathPoint in singlePath: posX, posY = singlePathPoint[1] diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 574e2253c..394f83786 100644 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -60,15 +60,6 @@ class MyEffect(inkex.Effect): self.OptionParser.add_option('--debug', action='store', type='inkbool', dest='debug', default='FALSE', help='Show debug information') def effect(self): - # gracefully exit script when pySerial is missing - try: - import serial - except ImportError, e: - inkex.errormsg(_("pySerial is not installed." - + "\n\n1. Download pySerial here (not the \".exe\"!): http://pypi.python.org/pypi/pyserial" - + "\n2. Extract the \"serial\" subfolder from the zip to the following folder: C:\\[Program files]\\inkscape\\python\\Lib\\" - + "\n3. Restart Inkscape.")) - return # get hpgl data myHpglEncoder = hpgl_encoder.hpglEncoder(self) try: @@ -133,6 +124,15 @@ class MyEffect(inkex.Effect): self.hpgl += '@' def sendHpglToSerial(self): + # gracefully exit script when pySerial is missing + try: + import serial + except ImportError, e: + inkex.errormsg(_("pySerial is not installed." + + "\n\n1. Download pySerial here (not the \".exe\"!): http://pypi.python.org/pypi/pyserial" + + "\n2. Extract the \"serial\" subfolder from the zip to the following folder: C:\\[Program files]\\inkscape\\python\\Lib\\" + + "\n3. Restart Inkscape.")) + return # send data to plotter mySerial = serial.Serial() mySerial.port = self.options.serialPort |
