I've been trying to write my Inkscape extensions but kept on getting dependency errors when I try to run it. I'm wondering if anyone can help me out? My code and error message below:
~/.inkscape/extensions/clear_all_guides.inx
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension>
<_name>Clear all guides</_name>
<id>sml.inkex.guides.clear</id>
<dependency type="executable" location="extenions">clear_all_guides.py</dependency>
<dependency type="executable" location="extenions">inkex.py</dependency>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu _name="SML" />
</effects-menu>
<script>
<command reldir="extensions" interpreter="python">clear_all_guides.py</command>
</script>
</effect>
</inkscape-extension>
~/.inkscape/extensions/clear_all_guides.py
Code: Select all
#!/usr/bin/env python
'''
Inkscape Extension: Remove all the guides in the document.
'''
import sys
sys.path.append('/usr/share/inkscape/extensions')
import inkex
class ClearAllGuidesEffect(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
def effect(self):
namedview = self.document.xpath('/svg:svg/sodipodi:namedview', namespaces=inkex.NSS)
if namedview:
for node in self.document.xpath('/svg:svg/sodipodi:namedview/sodipodi:guide', namespaces=inkex.NSS):
parent = node.getparent()
parent.remove(node)
effect = ClearAllGuidesEffect()
effect.affect()
~/.inkscape/extension-errors.log
Code: Select all
Extension "Clear all guides" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: clear_all_guides.py
Extension "Clear all guides" failed to load because a dependency was not met.
Dependency:
type: executable
location: path
string: inkex.py
As an fyi, the menu "SML" does show up on the extension menu, though the "Clear all guides" menu item does not - so I know that Inkscape does see my files which makes it all the more curious why the files 'failed to load'.
Any help would be greatly appreciated!
Thanks in advance,
See-ming