--- a/plcopen/POUVariablesCollector.py Sun Feb 18 21:30:48 2018 +0100
+++ b/plcopen/POUVariablesCollector.py Sun Feb 18 21:51:33 2018 +0100
@@ -63,9 +63,14 @@
XSLTModelQuery.__init__(self,
controller,
"pou_variables.xslt",
- [(name, lambda *x : getattr(self.factory, name)(*x))
+ [(name, self.FactoryCaller(name))
for name in ["SetRoot", "AddVariable"]])
+ def FactoryCaller(self, funcname):
+ def CallFactory(*args):
+ return getattr(self.factory, funcname)(*args)
+ return CallFactory
+
def Collect(self, root, debug):
self.factory = VariablesTreeInfosFactory()
self._process_xslt(root, debug)