Exemplo n.º 1
0
 def get_configurables(self, recursive = True, top = True) :
     confs = Configurable.get_configurables(self, recursive, top)
     # Exclude TupleToolDecay instances that represent branches
     # - they're treated separately.
     if hasattr(self, 'Branches') :
         branchNames = self.Branches.keys()
         confs = filter(lambda conf : conf.get_own_name() not in branchNames, confs)
     return confs
Exemplo n.º 2
0
 def get_configurables(self, recursive = True, top = True) :
     confs = Configurable.get_configurables(self, recursive, top)
     # Exclude TupleToolDecay instances that represent branches
     # - they're treated separately.
     if hasattr(self, 'Branches') :
         branchNames = self.Branches.keys()
         confs = filter(lambda conf : conf.get_own_name() not in branchNames, confs)
     return confs
Exemplo n.º 3
0
    def get_own_configuration_lines(self, ownVarName = None) :
        lines = Configurable.get_own_configuration_lines(self, ownVarName)
        # Extra bits to configure branches.
        if hasattr(self, 'Branches') :
            lines += self.get_init_string() + '.addBranches({0!r})\n\n'.format(self.Branches)
            branchNames = self.Branches.keys()
            branchConfigs = [getattr(self, branchName) for branchName in branchNames]
            for branch in branchConfigs :
                initName = self.get_init_string() + '.' + branch.get_own_name()
                lines += branch.get_configuration_lines(initName)

        return lines
Exemplo n.º 4
0
    def get_own_configuration_lines(self, ownVarName = None) :
        lines = Configurable.get_own_configuration_lines(self, ownVarName)
        # Extra bits to configure branches.
        if hasattr(self, 'Branches') :
            lines += self.get_init_string() + '.addBranches({0!r})\n\n'.format(self.Branches)
            branchNames = self.Branches.keys()
            branchConfigs = [getattr(self, branchName) for branchName in branchNames]
            for branch in branchConfigs :
                initName = self.get_init_string() + '.' + branch.get_own_name()
                lines += branch.get_configuration_lines(initName)

        return lines
Exemplo n.º 5
0
 def get_constructor_args(self) :
     props = Configurable.get_constructor_args(self)
     if props.has_key('Branches') :
         del props['Branches']
     return props
Exemplo n.º 6
0
 def get_constructor_args(self) :
     props = Configurable.get_constructor_args(self)
     if props.has_key('Branches') :
         del props['Branches']
     return props