From 5ca1d91f3e398545c476bd317826b04941e6f98d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 7 Apr 2012 12:33:13 -0400 Subject: [PATCH] Use __all__ within e.w.copyvios and shorter imports --- earwigbot/wiki/copyvios/__init__.py | 8 +++++--- earwigbot/wiki/copyvios/markov.py | 2 ++ earwigbot/wiki/copyvios/parsers.py | 2 ++ earwigbot/wiki/copyvios/search.py | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/earwigbot/wiki/copyvios/__init__.py b/earwigbot/wiki/copyvios/__init__.py index 46b27e2..a206a70 100644 --- a/earwigbot/wiki/copyvios/__init__.py +++ b/earwigbot/wiki/copyvios/__init__.py @@ -30,11 +30,13 @@ try: except ImportError: oauth = None -from earwigbot.wiki.copyvios.markov import MarkovChain, MarkovChainIntersection -from earwigbot.wiki.copyvios.parsers import ArticleTextParser, HTMLTextParser -from earwigbot.wiki.copyvios.search import YahooBOSSSearchEngine +from earwigbot.wiki.copyvios.markov import * +from earwigbot.wiki.copyvios.parsers import * +from earwigbot.wiki.copyvios.search import * from earwigbot.wiki.exceptions import * +__all__ = ["CopyvioCheckResult", "CopyvioMixin"] + class CopyvioCheckResult(object): def __init__(self, violation, confidence, url, queries, article, chains): self.violation = violation diff --git a/earwigbot/wiki/copyvios/markov.py b/earwigbot/wiki/copyvios/markov.py index 4e77ebc..74783d0 100644 --- a/earwigbot/wiki/copyvios/markov.py +++ b/earwigbot/wiki/copyvios/markov.py @@ -23,6 +23,8 @@ from collections import defaultdict from re import sub, UNICODE +__all__ = ["MarkovChain", "MarkovChainIntersection"] + class MarkovChain(object): START = -1 END = -2 diff --git a/earwigbot/wiki/copyvios/parsers.py b/earwigbot/wiki/copyvios/parsers.py index f9bb4c2..9e97267 100644 --- a/earwigbot/wiki/copyvios/parsers.py +++ b/earwigbot/wiki/copyvios/parsers.py @@ -20,6 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +__all__ = ["BaseTextParser", "ArticleTextParser", "HTMLTextParser"] + class BaseTextParser(object): def __init__(self, text): self.text = text diff --git a/earwigbot/wiki/copyvios/search.py b/earwigbot/wiki/copyvios/search.py index 59287cc..bc9dfe4 100644 --- a/earwigbot/wiki/copyvios/search.py +++ b/earwigbot/wiki/copyvios/search.py @@ -30,6 +30,8 @@ except ImportError: from earwigbot.wiki.exceptions import SearchQueryError +__all__ = ["BaseSearchEngine", "YahooBOSSSearchEngine"] + class BaseSearchEngine(object): def __init__(self, cred): """Store credentials 'cred' for searching later on."""