コード例 #1
0
    def __init__(self, channel_type):
        '''
        Initialize empty Channel Template with specific type
        '''

        ChannelType.__init__(self, channel_type)
        ChannelStyle.__init__(self, channel_type)
        Template.__init__(self)

        self.__input_templates = []         # track added input templates
        self.__input_template_types = set() # track added input template types
コード例 #2
0
    def __str__(self):
        '''
        Add counter of templates to print
        '''

        return ("<{Class} with {templates} input template(s) at 0x{ID:x}>\n"
                "  + {ChannelTypeStr}\n"
                "  + {TemplateStr}").format(
                    Class = self.__class__.__name__,
                    templates = len(self.input_templates),
                    ChannelTypeStr = ChannelType.__str__(self),
                    TemplateStr = Template.__str__(self),
                    ID = id(self))
コード例 #3
0
    def __contains__(self, value):

        return (ChannelType.__contains__(self, value) and
                ChannelStyle.__contains__(self, value))