diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2017-01-24 17:52:08 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2017-01-24 17:52:08 +0000 |
| commit | 1877acd7dc37abe559c94d3abea5e9148fce8fab (patch) | |
| tree | 3ba105643f077c1c415579c290273f03b0e8dc9a /share/extensions | |
| parent | Update to trunk (diff) | |
| download | inkscape-1877acd7dc37abe559c94d3abea5e9148fce8fab.tar.gz inkscape-1877acd7dc37abe559c94d3abea5e9148fce8fab.zip | |
Put namespace as constant
(bzr r15142.1.40)
Diffstat (limited to 'share/extensions')
| -rwxr-xr-x | share/extensions/hpgl_output.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index 367a9addd..f31c3fc2d 100755 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -45,6 +45,7 @@ class HpglOutput(inkex.Effect): self.OptionParser.add_option('--precut', action='store', type='inkbool', dest='precut', default='TRUE', help='Use precut') self.OptionParser.add_option('--flat', action='store', type='float', dest='flat', default=1.2, help='Curve flatness') self.OptionParser.add_option('--autoAlign', action='store', type='inkbool', dest='autoAlign', default='TRUE', help='Auto align') + self.DOCROTATE = "{http://www.inkscape.org/namespaces/inkscape}document_rotation" def effect(self): self.options.debug = False @@ -54,8 +55,8 @@ class HpglOutput(inkex.Effect): nv = svg.xpath(xpathStr, namespaces=NSS) document_rotate = "0" if nv != []: - document_rotate = nv[0].get("{http://www.inkscape.org/namespaces/inkscape}document-rotation") - nv[0].set("{http://www.inkscape.org/namespaces/inkscape}document-rotation","0") + document_rotate = nv[0].get(self.DOCROTATE) + nv[0].set(self.DOCROTATE,"0") myHpglEncoder = hpgl_encoder.hpglEncoder(self) try: self.hpgl, debugObject = myHpglEncoder.getHpgl() @@ -65,12 +66,12 @@ class HpglOutput(inkex.Effect): inkex.errormsg(_("No paths where found. Please convert all objects you want to save into paths.")) self.hpgl = '' if nv != [] and document_rotate: - nv[0].set("{http://www.inkscape.org/namespaces/inkscape}document_rotation",document_rotate) + nv[0].set("inkscape:document_rotation",document_rotate) return else: type, value, traceback = sys.exc_info() if nv != [] and document_rotate: - nv[0].set("{http://www.inkscape.org/namespaces/inkscape}document_rotation",document_rotate) + nv[0].set("inkscape:document_rotation",document_rotate) raise ValueError, ("", type, value), traceback # convert raw HPGL to HPGL hpglInit = 'IN' @@ -80,7 +81,7 @@ class HpglOutput(inkex.Effect): hpglInit += ';VS%d' % self.options.speed self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; ' if nv != [] and document_rotate: - nv[0].set("{http://www.inkscape.org/namespaces/inkscape}document_rotation",document_rotate) + nv[0].set("inkscape:document_rotation",document_rotate) def output(self): # print to file |
