61 """ object for collecting instances path list""" |
61 """ object for collecting instances path list""" |
62 def __init__(self, controller): |
62 def __init__(self, controller): |
63 XSLTModelQuery.__init__(self, |
63 XSLTModelQuery.__init__(self, |
64 controller, |
64 controller, |
65 "pou_variables.xslt", |
65 "pou_variables.xslt", |
66 [(name, lambda *x : getattr(self.factory, name)(*x)) |
66 [(name, self.FactoryCaller(name)) |
67 for name in ["SetRoot", "AddVariable"]]) |
67 for name in ["SetRoot", "AddVariable"]]) |
|
68 |
|
69 def FactoryCaller(self, funcname): |
|
70 def CallFactory(*args): |
|
71 return getattr(self.factory, funcname)(*args) |
|
72 return CallFactory |
68 |
73 |
69 def Collect(self, root, debug): |
74 def Collect(self, root, debug): |
70 self.factory = VariablesTreeInfosFactory() |
75 self.factory = VariablesTreeInfosFactory() |
71 self._process_xslt(root, debug) |
76 self._process_xslt(root, debug) |
72 res = self.factory.GetRoot() |
77 res = self.factory.GetRoot() |