ソースを参照

Update imports and exceptions.

tags/v0.1^2
Ben Kurtovic 12年前
コミット
7dbbe9683c
2個のファイルの変更10行の追加8行の削除
  1. +9
    -7
      earwigbot/wiki/copyvios/__init__.py
  2. +1
    -1
      earwigbot/wiki/copyvios/search.py

+ 9
- 7
earwigbot/wiki/copyvios/__init__.py ファイルの表示

@@ -31,9 +31,9 @@ except ImportError:
oauth = None

from earwigbot import exceptions
from earwigbot.wiki.copyvios.markov import *
from earwigbot.wiki.copyvios.parsers import *
from earwigbot.wiki.copyvios.search import *
from earwigbot.wiki.copyvios.markov import MarkovChain, MarkovChainIntersection
from earwigbot.wiki.copyvios.parsers import ArticleTextParser, HTMLTextParser
from earwigbot.wiki.copyvios.search import YahooBOSSSearchEngine

__all__ = ["CopyvioCheckResult", "CopyvioMixIn"]

@@ -107,14 +107,16 @@ class CopyvioMixIn(object):
if engine == "Yahoo! BOSS":
if not oauth:
e = "The package 'oauth2' could not be imported"
raise UnsupportedSearchEngineError(e)
raise exceptions.UnsupportedSearchEngineError(e)
return YahooBOSSSearchEngine(credentials)

raise UnknownSearchEngineError(engine)
raise exceptions.UnknownSearchEngineError(engine)

def _copyvio_compare_content(self, article, url):
"""
DOCSTRING NEEDED
"""Return a number comparing an article and a URL.

The *article* is a Markov chain, whereas the URL is a string that we
will try to open ourselves.
"""
html = self._open_url_ignoring_errors(url)
if not html:


+ 1
- 1
earwigbot/wiki/copyvios/search.py ファイルの表示

@@ -28,7 +28,7 @@ try:
except ImportError:
oauth = None

from earwigbot.wiki.exceptions import SearchQueryError
from earwigbot.exceptions import SearchQueryError

__all__ = ["BaseSearchEngine", "YahooBOSSSearchEngine"]



読み込み中…
キャンセル
保存