""" Displayer """


class BaseDisplayer(object):
    """ absctract class for displayer """
    def to_summary(self, message):
        """
        define how message display in summary widget

        :param message: message that defined at DataStore implementation
        :type message: depend on DataStore

        Return str
        """
        raise NotImplementedError

    def match(self, search, message, summary):
        """
        define is that the message match the search pattern
        default implement is to check is search contains in summary

        :param search: search keyword
        :type search: str

        :param message: message that defined at DataStore implementation
        :type message: depend on DataStore

        :param summary: summary that was generated by to_summary
        :type summary: str

        Return Ture or False
        """
        return search in summary

    def get_detail_displayers(self):
        """
        return a list of tuple that contains view name and a func that transform message into detail group
        """
        raise NotImplementedError
