From 64edc550617123b661f6e7ee9899ae4b0fc19af4 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Thu, 21 Jan 2016 22:15:17 -0600 Subject: [PATCH] Add method to build Tries from Notifiers --- flake8/plugins/manager.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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."""