mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 18:56:53 +00:00
Add method to build Tries from Notifiers
This commit is contained in:
parent
c67735792b
commit
64edc55061
1 changed files with 9 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ import logging
|
|||
|
||||
import pkg_resources
|
||||
|
||||
from flake8 import _trie
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
__all__ = (
|
||||
|
|
@ -249,6 +251,13 @@ class Listeners(PluginTypeManager):
|
|||
|
||||
namespace = 'flake8.listen'
|
||||
|
||||
def build_trie(self):
|
||||
"""Build a Trie for our Listeners."""
|
||||
trie = _trie.Trie()
|
||||
for name in self.names:
|
||||
trie.add(name, self.manager[name])
|
||||
return trie
|
||||
|
||||
|
||||
class ReportFormatters(PluginTypeManager):
|
||||
"""All of the report formatters registered through entry-points."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue