Code

Added getParentNode() to Effect class in inkex.py
authorAurélio A. Heckert (a) <auriumgmaildotcom>
Fri, 5 Mar 2010 23:37:41 +0000 (20:37 -0300)
committerAurélio A. Heckert (a) <auriumgmaildotcom>
Fri, 5 Mar 2010 23:37:41 +0000 (20:37 -0300)
share/extensions/inkex.py

index 1a70c25d6e9e94bacb0c19e4f991108a677a4b94..49de51ef31e6fa8ca533671024fcf3f95425e12e 100755 (executable)
@@ -175,6 +175,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: