plcopen/InstancesPathCollector.py
changeset 1953 5736d25bb393
parent 1942 a4382ae1ba82
child 3750 f62625418bff
equal deleted inserted replaced
1952:0c20fc810d61 1953:5736d25bb393
     3 # This file is part of Beremiz.
     3 # This file is part of Beremiz.
     4 # See COPYING file for copyrights details.
     4 # See COPYING file for copyrights details.
     5 
     5 
     6 from __future__ import absolute_import
     6 from __future__ import absolute_import
     7 from plcopen.XSLTModelQuery import XSLTModelQuery
     7 from plcopen.XSLTModelQuery import XSLTModelQuery
       
     8 
     8 
     9 
     9 class InstancesPathCollector(XSLTModelQuery):
    10 class InstancesPathCollector(XSLTModelQuery):
    10     """ object for collecting instances path list"""
    11     """ object for collecting instances path list"""
    11     def __init__(self, controller):
    12     def __init__(self, controller):
    12         self.Instances = []
    13         self.Instances = []
    17 
    18 
    18     def AddInstance(self, context, *args):
    19     def AddInstance(self, context, *args):
    19         self.Instances.append(args[0][0])
    20         self.Instances.append(args[0][0])
    20 
    21 
    21     def Collect(self, root, name, debug):
    22     def Collect(self, root, name, debug):
    22         self._process_xslt(root, debug, instance_type = name)
    23         self._process_xslt(root, debug, instance_type=name)
    23         res = self.Instances
    24         res = self.Instances
    24         self.Instances = []
    25         self.Instances = []
    25         return res
    26         return res
    26