Difference between revisions of "Talk:PythonEffectTutorial"

From Inkscape Wiki
Jump to navigation Jump to search
(Tutorial still valid for current lxml?)
 
(should work now)
Line 1: Line 1:
==Current issues==
==Current issues==
Excerpt from an email I sent to the inkscape-devel list:
* None left that I know of, it should work now with a current installation. --[[User:Rubikcube|Rubikcube]] 21:21, 7 August 2008 (UTC)
<blockquote>Hello,
I hope this list is the correct one for this kind of question:
Has anyone managed to get http://wiki.inkscape.org/wiki/index.php/PythonEffectTutorial to work without major changes? It failed for me both on a gentoo system and on a pretty vanilla Ubuntu 8.04 box. I don't know if I will find the time to edit the wiki page according to the current lxml behaviour, but I might give it a try. Additionally Ishmal(I think) said on irc/jabber that lxml might not be used in the future anymore anyway.
 
Now for the list of problems I encountered:
* Simply making the file executable and putting it into ~/.inkscape/extensions/ is not sufficient, it won't find inkex there, but no problem, simply add
  import sys
  sys.path.append('/usr/share/inkscape/extensions') # or another path, as appropriate for your installation
to the top of it.  A minor problem.
* All the getElementsByTagName, getAttribute, createElement,... methods are unknown to lxml, at least in the versions here (1.3.6). Inkscape returns the python error message ending with:
  File "/home/dhornun/.inkscape/extensions/helloworld.py", line 32, in effect
      svg = self.document.getElementsByTagName('svg')[0]
  AttributeError: 'etree._ElementTree' object has no attribute 'getElementsByTagName'
If this is not a problem on the distributions' side, those can probably be fixed by adapting the code to reflect lxml's current API.
</blockquote>
Hopefully I'll find the time to fix this either on my machine or here in the wiki.  The first point was fixed already. --[[User:Rubikcube|Rubikcube]] 07:32, 30 July 2008 (UTC)

Revision as of 21:21, 7 August 2008

Current issues

  • None left that I know of, it should work now with a current installation. --Rubikcube 21:21, 7 August 2008 (UTC)