From 3174646c68a76a61bf130d76dd6fc11976074f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20W=C3=BCst?= Date: Sun, 2 Mar 2014 21:27:16 +0100 Subject: cleanup (bzr r13093) --- share/extensions/hpgl_output.inx | 4 ++-- share/extensions/hpgl_output.py | 4 ++-- share/extensions/plotter.inx | 8 ++++---- share/extensions/plotter.py | 23 ++++++++++++----------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/share/extensions/hpgl_output.inx b/share/extensions/hpgl_output.inx index 5f197b5ae..d16cc55e5 100644 --- a/share/extensions/hpgl_output.inx +++ b/share/extensions/hpgl_output.inx @@ -8,7 +8,7 @@ inkex.py <_param name="introduction" type="description">Please make sure that all objects you want to save are converted to paths. Please use the plotter extension (Extensions menu) to plot directly over a serial connection. - + 1016.0 1016.0 1 @@ -24,7 +24,7 @@ false false - + 1.00 0.25 true diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index d8f082da5..5b5521926 100755 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -26,7 +26,7 @@ import inkex inkex.localize() -class MyEffect(inkex.Effect): +class HpglOutput(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) @@ -69,7 +69,7 @@ class MyEffect(inkex.Effect): if __name__ == '__main__': # start extension - e = MyEffect() + e = HpglOutput() e.affect() # 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.inx b/share/extensions/plotter.inx index c4b3e2b25..fc620f8a3 100644 --- a/share/extensions/plotter.inx +++ b/share/extensions/plotter.inx @@ -8,7 +8,7 @@ inkex.py <_param name="introduction" type="description">Please make sure that all objects you want to plot are converted to paths. - + COM1 @@ -43,7 +43,7 @@ <_param name="serialHelp" type="description">This can be a physical serial connection or a USB-to-Serial bridge. Ask your plotter manufacturer for drivers if needed. <_param name="parallelHelp" type="description">Parallel (LPT) connections are not supported. - + 1016.0 1016.0 1 @@ -59,7 +59,7 @@ false false - + 1.00 0.25 true @@ -70,7 +70,7 @@ <_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter. - + path diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 056a90fe3..be59f604b 100644 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -30,7 +30,7 @@ import inkex inkex.localize() -class MyEffect(inkex.Effect): +class Plot(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) @@ -70,16 +70,17 @@ class MyEffect(inkex.Effect): raise ValueError, ('', type, value), traceback # TODO: 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. (Remember to set to true) - # This outcommented code has a user unit issue (getSvg produces px, docWidth could be mm or something else) ''' - # reparse data for preview - self.options.showMovements = True - 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) - doc, warnings = myHpglDecoder.getSvg() - # deliver document to inkscape - self.document = doc + if MAGIC: + # reparse data for preview + self.options.showMovements = True + self.options.docWidth = self.uutounit(self.unittouu(self.document.getroot().get('width')), "px") + self.options.docHeight = self.uutounit(self.unittouu(self.document.getroot().get('height')), "px") + myHpglDecoder = hpgl_decoder.hpglDecoder(self.hpgl, self.options) + doc, warnings = myHpglDecoder.getSvg() + # deliver document to inkscape + self.document = doc + else: ''' # convert to other formats if self.options.commandLanguage == 'DMPL': @@ -207,7 +208,7 @@ class MyEffect(inkex.Effect): if __name__ == '__main__': # start extension - e = MyEffect() + e = Plot() e.affect() # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 \ No newline at end of file -- cgit v1.2.3