diff --git a/flake8/plugins/manager.py b/flake8/plugins/manager.py index 8fd3a24..ce74e08 100644 --- a/flake8/plugins/manager.py +++ b/flake8/plugins/manager.py @@ -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."""