From: acspike Date: Sun, 10 Feb 2008 20:31:19 +0000 (+0000) Subject: Partial fix X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=116aae64977c7eab27f283e827d12c4f3c71583e;p=inkscape.git Partial fix This effect is currently broken and stands to be removed from the 0.46 release I'm committing this partial fix, which updates the script for lxml anyway The next stage will require updating the script-fu portion of the script to operate with newer gimps (would be great if it could work with new and old!) --- diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 998f5d9a1..b7f0ff78f 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -26,18 +26,18 @@ class MyEffect(inkex.Effect): pass def effect(self): svg_file = self.args[-1] - node = inkex.xml.xpath.Evaluate('/svg',self.document)[0] - docname = node.attributes.getNamedItemNS(inkex.NSS[u'sodipodi'],'docname').value[:-4] + docname = self.xpathSingle('/svg:svg/@sodipodi:docname')[:-4] #create os temp dir tmp_dir = tempfile.mkdtemp() area = '--export-area-canvas' pngs = [] - names = [] - path = "/svg/*[name()='g' or @style][@id]" - for node in inkex.xml.xpath.Evaluate(path,self.document): - id = node.attributes.getNamedItem('id').value + names = [] + path = "/svg:svg/*[name()='g' or @style][@id]" + for node in self.document.xpath(path,inkex.NSS): + id = node.get('id') + inkex.debug(id) name = "%s.png" % id filename = os.path.join(tmp_dir, name) command = "inkscape -i %s -j %s -e %s %s " % (id, area, filename, svg_file) @@ -49,7 +49,7 @@ class MyEffect(inkex.Effect): names.append(id) filelist = '"%s"' % '" "'.join(pngs) - namelist = '"%s"' % '" "'.join(names) + namelist = '"%s"' % '" "'.join(names) xcf = os.path.join(tmp_dir, "%s.xcf" % docname) script_fu = """ (define