Bläddra i källkod

CopyrightMixin needs Page._site

tags/v0.1^2
Ben Kurtovic 13 år sedan
förälder
incheckning
13100533b9
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. +2
    -2
      earwigbot/wiki/copyright.py
  2. +1
    -1
      earwigbot/wiki/page.py

+ 2
- 2
earwigbot/wiki/copyright.py Visa fil

@@ -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 Visa fil

@@ -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


Laddar…
Avbryt
Spara