Code

giving svg_file property to Effect class. Make more readable code.
authoraurium <aurium@users.sourceforge.net>
Wed, 9 Sep 2009 17:43:37 +0000 (17:43 +0000)
committeraurium <aurium@users.sourceforge.net>
Wed, 9 Sep 2009 17:43:37 +0000 (17:43 +0000)
share/extensions/inkex.py

index 665575c6b67b0047a98d2f7af66ba42409b7821f..b7e3e0e63f5bdb34f378d1c58a6e05735cba7424 100755 (executable)
@@ -132,7 +132,7 @@ class Effect:
             try:
                 stream = open(file,'r')
             except:
-                stream = open(self.args[-1],'r')
+                stream = open(self.svg_file,'r')
         except:
             stream = sys.stdin
         self.document = etree.parse(stream)
@@ -198,6 +198,7 @@ class Effect:
 
     def affect(self, args=sys.argv[1:], output=True):
         """Affect an SVG document with a callback effect"""
+        self.svg_file = args[-1]
         self.getoptions(args)
         self.parse()
         self.getposinlayer()