From 2660ddd03107cbdf18ef27c83d49c89b72625eaa Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sun, 10 Jul 2016 09:29:06 -0500 Subject: [PATCH] Move trie implementation out of plugins We're going to use it for statistics, so it no longer belongs hidden in the flake8.plugins namespace. --- docs/source/internal/plugin_handling.rst | 4 ++-- src/flake8/{plugins => }/_trie.py | 0 src/flake8/plugins/notifier.py | 2 +- tests/unit/test_trie.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/flake8/{plugins => }/_trie.py (100%) diff --git a/docs/source/internal/plugin_handling.rst b/docs/source/internal/plugin_handling.rst index 9af3182..9ef1c32 100644 --- a/docs/source/internal/plugin_handling.rst +++ b/docs/source/internal/plugin_handling.rst @@ -69,7 +69,7 @@ notified. To implement this goal, we needed an object to store listeners in that would allow for efficient look up - a Trie (or Prefix Tree). Given that none of the existing packages on PyPI allowed for storing data on each node of the trie, -it was left up to write our own as :class:`~flake8.plugins._trie.Trie`. On +it was left up to write our own as :class:`~flake8._trie.Trie`. On top of that we layer our :class:`~flake8.plugins.notifier.Notifier` class. Now when |Flake8| receives an error or warning, we can easily call the @@ -122,7 +122,7 @@ API Documentation .. autoclass:: flake8.plugins.notifier.Notifier -.. autoclass:: flake8.plugins._trie.Trie +.. autoclass:: flake8._trie.Trie .. |PluginManager| replace:: :class:`~flake8.plugins.manager.PluginManager` .. |Plugin| replace:: :class:`~flake8.plugins.manager.Plugin` diff --git a/src/flake8/plugins/_trie.py b/src/flake8/_trie.py similarity index 100% rename from src/flake8/plugins/_trie.py rename to src/flake8/_trie.py diff --git a/src/flake8/plugins/notifier.py b/src/flake8/plugins/notifier.py index dc255c4..b0034f6 100644 --- a/src/flake8/plugins/notifier.py +++ b/src/flake8/plugins/notifier.py @@ -1,5 +1,5 @@ """Implementation of the class that registers and notifies listeners.""" -from flake8.plugins import _trie +from flake8 import _trie class Notifier(object): diff --git a/tests/unit/test_trie.py b/tests/unit/test_trie.py index 152b5b6..4cbd8c5 100644 --- a/tests/unit/test_trie.py +++ b/tests/unit/test_trie.py @@ -1,5 +1,5 @@ """Unit test for the _trie module.""" -from flake8.plugins import _trie as trie +from flake8 import _trie as trie class TestTrie(object):