mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-16 17:19:52 +00:00
Build a Notifier instead of a Trie
This commit is contained in:
parent
6e8e2b9669
commit
04556f1a1b
1 changed files with 13 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ import logging
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from flake8 import _trie
|
from flake8 import notifier
|
||||||
from flake8 import exceptions
|
from flake8 import exceptions
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
@ -264,12 +264,19 @@ class Listeners(PluginTypeManager):
|
||||||
|
|
||||||
namespace = 'flake8.listen'
|
namespace = 'flake8.listen'
|
||||||
|
|
||||||
def build_trie(self):
|
def build_notifier(self):
|
||||||
"""Build a Trie for our Listeners."""
|
"""Build a Notifier for our Listeners.
|
||||||
trie = _trie.Trie()
|
|
||||||
|
: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:
|
for name in self.names:
|
||||||
trie.add(name, self.manager[name])
|
notifier_trie.register_listener(name, self.manager[name])
|
||||||
return trie
|
return notifier_trie
|
||||||
|
|
||||||
|
|
||||||
class ReportFormatters(PluginTypeManager):
|
class ReportFormatters(PluginTypeManager):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue