Quellcode durchsuchen

CopyrightMixin needs Page._site

tags/v0.1^2
Ben Kurtovic vor 13 Jahren
Ursprung
Commit
13100533b9
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. +2
    -2
      earwigbot/wiki/copyright.py
  2. +1
    -1
      earwigbot/wiki/page.py

+ 2
- 2
earwigbot/wiki/copyright.py Datei anzeigen

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

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


Laden…
Abbrechen
Speichern