Code

little change to meke extensions more testables
authoraurium <aurium@users.sourceforge.net>
Fri, 9 Jan 2009 00:27:15 +0000 (00:27 +0000)
committeraurium <aurium@users.sourceforge.net>
Fri, 9 Jan 2009 00:27:15 +0000 (00:27 +0000)
share/extensions/inkex.py

index d395769d3a44a2f4c364d4cd7d7dc7884e2182bc..49f875ac2ad06e0bc5025c6e59ff9b651bd3a2b9 100755 (executable)
@@ -165,15 +165,15 @@ class Effect:
     def output(self):
         """Serialize document into XML on stdout"""
         self.document.write(sys.stdout)
-    def affect(self):
+    def affect(self, args=sys.argv[1:], output=True):
         """Affect an SVG document with a callback effect"""
-        self.getoptions()
+        self.getoptions(args)
         self.parse()
         self.getposinlayer()
         self.getselected()
         self.getdocids()
         self.effect()
-        self.output()
+        if output: self.output()
         
     def uniqueId(self, old_id, make_new_id = True):
         new_id = old_id