Code

share/extensions/inkex.py: Fix a couple of issues reported by pychecker.
authorpjrm <pjrm@users.sourceforge.net>
Fri, 27 Feb 2009 02:15:41 +0000 (02:15 +0000)
committerpjrm <pjrm@users.sourceforge.net>
Fri, 27 Feb 2009 02:15:41 +0000 (02:15 +0000)
share/extensions/inkex.py

index 98ebf9d1fc2e3c6d8570667e8de963fbdc7653f6..adc0d0fed59e6f246ecb855314ec9a78b2a1d02e 100755 (executable)
@@ -90,7 +90,7 @@ def check_inkbool(option, opt, value):
     elif str(value).capitalize() == 'False':
         return False
     else:
-        raise OptionValueError("option %s: invalid inkbool value: %s" % (opt, value))
+        raise optparse.OptionValueError("option %s: invalid inkbool value: %s" % (opt, value))
 
 def addNS(tag, ns=None):
     val = tag
@@ -161,10 +161,10 @@ class Effect:
 
     def getselected(self):
         """Collect selected nodes"""
-        for id in self.options.ids:
-            path = '//*[@id="%s"]' % id
+        for i in self.options.ids:
+            path = '//*[@id="%s"]' % i
             for node in self.document.xpath(path, namespaces=NSS):
-                self.selected[id] = node
+                self.selected[i] = node
 
     def getdocids(self):
         docIdNodes = self.document.xpath('//@id', namespaces=NSS)