plcopen/POUVariablesCollector.py
changeset 1945 90bf6bd94b94
parent 1944 6162e34fb246
child 1952 0c20fc810d61
--- 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)