ソースを参照

CopyrightMixin needs Page._site

tags/v0.1^2
Ben Kurtovic 13年前
コミット
13100533b9
2個のファイルの変更3行の追加3行の削除
  1. +2
    -2
      earwigbot/wiki/copyright.py
  2. +1
    -1
      earwigbot/wiki/page.py

+ 2
- 2
earwigbot/wiki/copyright.py ファイルの表示

@@ -55,9 +55,9 @@ class CopyrightMixin(object):
checks the page for copyright violations using a search engine API. The
API keys must be provided to the method as arguments.
"""
def __init__(self):
def __init__(self, site):
self._opener = build_opener()
self._opener.addheaders = self._site._opener.addheaders
self._opener.addheaders = site._opener.addheaders

def _open_url_ignoring_errors(self, url):
"""Open a URL using self._opener and return its content, or None.


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

@@ -69,7 +69,7 @@ class Page(CopyrightMixin):
__init__ will not do any API queries, but it will use basic namespace
logic to determine our namespace ID and if we are a talkpage.
"""
super(Page, self).__init__()
super(Page, self).__init__(site)
self._site = site
self._title = title.strip()
self._follow_redirects = self._keep_following = follow_redirects


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