Code

Extensions. Fix misleading message in inkex.py (Bug #602041)
[inkscape.git] / share / extensions / inkex.py
index 1a70c25d6e9e94bacb0c19e4f991108a677a4b94..7d40bc70ca75f306ebdd4e28714844b86807396d 100755 (executable)
@@ -63,8 +63,9 @@ def uutounit(val, unit):
 
 try:
     from lxml import etree
-except:
-    sys.exit(_('The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml'))
+except Exception, e:
+    sys.exit(_("The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml\n\nTechnical details:\n%s" % (e,)))
 
 def debug(what):
     sys.stderr.write(str(what) + "\n")
@@ -175,6 +176,13 @@ class Effect:
         else:
           return None
 
+    def getParentNode(self, node):
+        for parent in self.document.getiterator():
+            if node in parent.getchildren():
+                return parent
+                break
+
+
     def getdocids(self):
         docIdNodes = self.document.xpath('//@id', namespaces=NSS)
         for m in docIdNodes: