示例#1
0
    def build_notifier(self):
        """Build a Notifier for our Listeners.

        :returns:
            Object to notify our listeners of certain error codes and
            warnings.
        :rtype:
            :class:`~flake8.notifier.Notifier`
        """
        notifier_trie = notifier.Notifier()
        for name in self.names:
            notifier_trie.register_listener(name, self.manager[name])
        return notifier_trie
示例#2
0
    def setup(self):
        """Set up each TestNotifier instance."""
        self.notifier = notifier.Notifier()
        self.listener_map = {}

        def add_listener(error_code):
            listener = _Listener(error_code)
            self.listener_map[error_code] = listener
            self.notifier.register_listener(error_code, listener)

        for i in range(10):
            add_listener('E{0}'.format(i))
            for j in range(30):
                add_listener('E{0}{1:02d}'.format(i, j))