=== modified file 'share/extensions/hpgl_output.py' --- share/extensions/hpgl_output.py 2017-01-24 17:52:08 +0000 +++ share/extensions/hpgl_output.py 2017-03-04 12:38:29 +0000 @@ -45,7 +45,6 @@ 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 @@ -53,10 +52,11 @@ svg = self.document.getroot() xpathStr = '//sodipodi:namedview' nv = svg.xpath(xpathStr, namespaces=NSS) - document_rotate = "0" + document_rotate = '0' if nv != []: - document_rotate = nv[0].get(self.DOCROTATE) - nv[0].set(self.DOCROTATE,"0") + document_rotate = nv[0].get(inkex.addNS('document-rotation', 'inkscape')) + if document_rotate != '0': + nv[0].set(inkex.addNS('document-rotation', 'inkscape'),"0") myHpglEncoder = hpgl_encoder.hpglEncoder(self) try: self.hpgl, debugObject = myHpglEncoder.getHpgl() @@ -65,13 +65,13 @@ # issue error if no paths found 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("inkscape:document_rotation",document_rotate) + if nv != [] and document_rotate != '0': + nv[0].set(inkex.addNS('document-rotation', 'inkscape'),document_rotate) return else: type, value, traceback = sys.exc_info() - if nv != [] and document_rotate: - nv[0].set("inkscape:document_rotation",document_rotate) + if nv != [] and document_rotate != '0': + nv[0].set(inkex.addNS('document-rotation', 'inkscape'),document_rotate) raise ValueError, ("", type, value), traceback # convert raw HPGL to HPGL hpglInit = 'IN' @@ -80,8 +80,8 @@ if self.options.speed > 0: hpglInit += ';VS%d' % self.options.speed self.hpgl = hpglInit + self.hpgl + ';SP0;PU0,0;IN; ' - if nv != [] and document_rotate: - nv[0].set("inkscape:document_rotation",document_rotate) + if nv != [] and document_rotate != '0': + nv[0].set(inkex.addNS('document-rotation', 'inkscape'),document_rotate) def output(self): # print to file === modified file 'share/extensions/synfig_output.py' --- share/extensions/synfig_output.py 2016-11-05 21:29:03 +0000 +++ share/extensions/synfig_output.py 2017-03-04 19:58:54 +0000 @@ -1046,17 +1046,11 @@ ###### Main Class ######################################### class SynfigExport(SynfigPrep): def __init__(self): - svg = self.document.getroot() - xpathStr = '//http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}:namedview' - res = svg.xpath(xpathStr, namespaces=inkex.NSS) - self.document_rotate = res[0].get("inkscape:document_rotation") - res[0].set("inkscape:document_rotation","0") SynfigPrep.__init__(self) def effect(self): # Prepare the document for exporting SynfigPrep.effect(self) - svg = self.document.getroot() width = get_dimension(svg.get("width", 1024)) height = get_dimension(svg.get("height", 768)) @@ -1078,10 +1072,6 @@ root_canvas.append(layer) d.get_root_tree().write(sys.stdout) - svg = self.document.getroot() - xpathStr = '//http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}:namedview' - res = svg.xpath(xpathStr, namespaces=inkex.NSS) - res[0].set("inkscape:document_rotation",self.document_rotate) def convert_node(self, node, d): """Convert an SVG node to a list of Synfig layers"""