From 13100533b95d1aed51658d3c31e674a5809c4c3f Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 31 Dec 2011 15:30:23 -0500 Subject: [PATCH] CopyrightMixin needs Page._site --- earwigbot/wiki/copyright.py | 4 ++-- earwigbot/wiki/page.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/earwigbot/wiki/copyright.py b/earwigbot/wiki/copyright.py index 5641a45..5af1fec 100644 --- a/earwigbot/wiki/copyright.py +++ b/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. diff --git a/earwigbot/wiki/page.py b/earwigbot/wiki/page.py index 1b2c06a..862da2b 100644 --- a/earwigbot/wiki/page.py +++ b/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