diff options
| author | Aaron Spike <aaron@ekips.org> | 2007-06-20 03:31:47 +0000 |
|---|---|---|
| committer | acspike <acspike@users.sourceforge.net> | 2007-06-20 03:31:47 +0000 |
| commit | de79ad1999f8021a2821f7bfe63756da74db28fa (patch) | |
| tree | cacd6d29a719f71e72b50bd15abaf46acd7d2e56 /share/extensions/interp.py | |
| parent | Forgot in earlier commit. (diff) | |
| download | inkscape-de79ad1999f8021a2821f7bfe63756da74db28fa.tar.gz inkscape-de79ad1999f8021a2821f7bfe63756da74db28fa.zip | |
Another round of extension conversion (from pyxml to lxml) and some corrections
(bzr r3079)
Diffstat (limited to 'share/extensions/interp.py')
| -rwxr-xr-x | share/extensions/interp.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/share/extensions/interp.py b/share/extensions/interp.py index f0ba8f26c..1b28f1bff 100755 --- a/share/extensions/interp.py +++ b/share/extensions/interp.py @@ -122,9 +122,9 @@ class Interp(inkex.Effect): styles = {} for id in self.options.ids: node = self.selected[id] - if node.tagName =='path': - paths[id] = cubicsuperpath.parsePath(node.attributes.getNamedItem('d').value) - styles[id] = simplestyle.parseStyle(node.attributes.getNamedItem('style').value) + if node.tag ==inkex.addNS('path','svg'): + paths[id] = cubicsuperpath.parsePath(node.get('d')) + styles[id] = simplestyle.parseStyle(node.get('style')) else: self.options.ids.remove(id) @@ -272,8 +272,7 @@ class Interp(inkex.Effect): if self.options.dup: steps = [0] + steps + [1] #create an interpolated path for each interval - group = self.document.createElement('svg:g') - self.current_layer.appendChild(group) + group = inkex.etree.SubElement(self.current_layer,inkex.addNS('g','svg')) for time in steps: interp = [] #process subpaths @@ -295,7 +294,6 @@ class Interp(inkex.Effect): #remove final subpath if empty. if not interp[-1]: del interp[-1] - new = self.document.createElement('svg:path') #basic style tweening if self.options.style: @@ -307,9 +305,8 @@ class Interp(inkex.Effect): if dofill: basestyle['fill-opacity'] = tweenstylefloat('fill-opacity',sst,est,time) basestyle['fill'] = tweenstylecolor('fill',sst,est,time) - new.setAttribute('style', simplestyle.formatStyle(basestyle)) - new.setAttribute('d', cubicsuperpath.formatPath(interp)) - group.appendChild(new) + attribs = {'style':simplestyle.formatStyle(basestyle),'d':cubicsuperpath.formatPath(interp)} + new = inkex.etree.SubElement(group,inkex.addNS('path','svg'), attribs) e = Interp() e.affect() |
