jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/434190 )
Change subject: [doc] __init__ method is initializer not a constructor
......................................................................
[doc] __init__ method is initializer not a constructor
The initializer is used to customize the class instance.
Change-Id: I40f1d82c8396dec6c8ac021817f5c79c0b3c7291
---
M generate_family_file.py
M pywikibot/bot.py
M pywikibot/bot_choice.py
M pywikibot/botirc.py
M pywikibot/comms/eventstreams.py
M pywikibot/comms/threadedhttp.py
M pywikibot/cosmetic_changes.py
M pywikibot/data/api.py
M pywikibot/data/wikistats.py
M pywikibot/date.py
M pywikibot/diff.py
M pywikibot/echo.py
M pywikibot/exceptions.py
M pywikibot/family.py
M pywikibot/flow.py
M pywikibot/interwiki_graph.py
M pywikibot/logentries.py
M pywikibot/login.py
M pywikibot/page.py
M pywikibot/pagegenerators.py
M pywikibot/proofreadpage.py
M pywikibot/site.py
M pywikibot/site_detect.py
M pywikibot/specialbots.py
M pywikibot/textlib.py
M pywikibot/throttle.py
M pywikibot/tools/__init__.py
M pywikibot/tools/_logging.py
M pywikibot/tools/djvu.py
M pywikibot/userinterfaces/gui.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/terminal_interface_win32.py
M pywikibot/xmlreader.py
M scripts/archivebot.py
M scripts/basic.py
M scripts/capitalize_redirects.py
M scripts/casechecker.py
M scripts/category.py
M scripts/category_redirect.py
M scripts/cfd.py
M scripts/checkimages.py
M scripts/claimit.py
M scripts/clean_sandbox.py
M scripts/commons_link.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/create_categories.py
M scripts/data_ingestion.py
M scripts/delete.py
M scripts/djvutext.py
M scripts/editarticle.py
M scripts/followlive.py
M scripts/freebasemappingupload.py
M scripts/harvest_template.py
M scripts/illustrate_wikidata.py
M scripts/image.py
M scripts/imagecopy.py
M scripts/imagecopy_self.py
M scripts/imagetransfer.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/isbn.py
M scripts/listpages.py
M scripts/lonelypages.py
M scripts/maintenance/cache.py
M scripts/maintenance/compat2core.py
M scripts/maintenance/make_i18n_dict.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/ndashredir.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/patrol.py
M scripts/piper.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/script_wui.py
M scripts/selflink.py
M scripts/solve_disambiguation.py
M scripts/spamremove.py
M scripts/states_redirect.py
M scripts/surnames_redirects.py
M scripts/table2wiki.py
M scripts/template.py
M scripts/unusedfiles.py
M scripts/weblinkchecker.py
M scripts/welcome.py
M scripts/wikisourcetext.py
M tests/__init__.py
M tests/aspects.py
M tests/deprecation_tests.py
M tests/utils.py
97 files changed, 271 insertions(+), 271 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/generate_family_file.py b/generate_family_file.py
index a93ff05..b46b632 100755
--- a/generate_family_file.py
+++ b/generate_family_file.py
@@ -40,7 +40,7 @@
"""Family file creator."""
def __init__(self, url=None, name=None, dointerwiki=None):
- """Constructor."""
+ """Initializer."""
if url is None:
url = raw_input("Please insert URL to wiki: ")
if name is None:
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index e6a058b..bc44150 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -147,7 +147,7 @@
message = 'Page "{0}" skipped due to {1}.'
def __init__(self, page, reason):
- """Constructor."""
+ """Initializer."""
super(SkipPageError, self).__init__(self.message.format(page, reason))
self.reason = reason
self.page = page
@@ -158,7 +158,7 @@
"""The given answer didn't suffice."""
def __init__(self, stop=False):
- """Constructor."""
+ """Initializer."""
self.stop = stop
@@ -167,7 +167,7 @@
"""Logging formatter that uses
config.console_encoding."""
def __init__(self, fmt=None, datefmt=None):
- """Constructor setting underlying encoding to
console_encoding."""
+ """Initializer setting underlying encoding to
console_encoding."""
_LoggingFormatter.__init__(self, fmt, datefmt, config.console_encoding)
@@ -530,7 +530,7 @@
"""A simple choice consisting of a option, shortcut and
handler."""
def __init__(self, option, shortcut, replacer):
- """Constructor."""
+ """Initializer."""
super(Choice, self).__init__(option, shortcut)
self._replacer = replacer
@@ -568,7 +568,7 @@
def __init__(self, option, shortcut, replacer, replace_section,
replace_label):
- """Constructor."""
+ """Initializer."""
super(LinkChoice, self).__init__(option, shortcut, replacer)
self._section = replace_section
self._label = replace_label
@@ -605,7 +605,7 @@
"""Add an option to always apply the default."""
def __init__(self, replacer, option='always', shortcut='a'):
- """Constructor."""
+ """Initializer."""
super(AlwaysChoice, self).__init__(option, shortcut, replacer)
self.always = False
@@ -651,7 +651,7 @@
def __init__(self, old_link, new_link, default=None, automatic_quit=True):
"""
- Constructor.
+ Initializer.
@param old_link: The old link which is searched. The label and section
are ignored.
@@ -1617,7 +1617,7 @@
"""
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
self._site = None
super(MultipleSitesBot, self).__init__(**kwargs)
@@ -1837,7 +1837,7 @@
@ivar create_missing_item: If True, new items will be created if the current
page doesn't have one. Subclasses should override this in the
- constructor with a bool value or using self.getOption.
+ initializer with a bool value or using self.getOption.
@type create_missing_item: bool
"""
@@ -1847,7 +1847,7 @@
@deprecated_args(use_from_page=None)
def __init__(self, **kwargs):
- """Constructor of the WikidataBot."""
+ """Initializer of the WikidataBot."""
self.create_missing_item = False
super(WikidataBot, self).__init__(**kwargs)
self.site = pywikibot.Site()
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index db6b1bd..3ae5c59 100755
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Choices for input_choice."""
#
-# (C) Pywikibot team, 2015-2016
+# (C) Pywikibot team, 2015-2018
#
# Distributed under the terms of the MIT license.
#
@@ -32,7 +32,7 @@
"""
def __init__(self, stop=True):
- """Constructor."""
+ """Initializer."""
super(Option, self).__init__()
self._stop = stop
@@ -99,7 +99,7 @@
"""An option with a description and shortcut and returning the
shortcut."""
def __init__(self, option, shortcut, stop=True):
- """Constructor."""
+ """Initializer."""
super(StandardOption, self).__init__(stop)
self.option = option
self.shortcut = shortcut.lower()
@@ -150,7 +150,7 @@
"""
def __init__(self, option, shortcut, description, options):
- """Constructor."""
+ """Initializer."""
super(NestedOption, self).__init__(option, shortcut, False)
self.description = description
self.options = options
@@ -179,7 +179,7 @@
"""An option to show more and more context."""
def __init__(self, option, shortcut, text, context, delta=100, start=0, end=0):
- """Constructor."""
+ """Initializer."""
super(ContextOption, self).__init__(option, shortcut, False)
self.text = text
self.context = context
@@ -208,7 +208,7 @@
"""An option allowing a range of integers."""
def __init__(self, minimum=1, maximum=None, prefix=''):
- """Constructor."""
+ """Initializer."""
super(IntegerOption, self).__init__()
if not ((minimum is None or isinstance(minimum, int)) and
(maximum is None or isinstance(maximum, int))):
@@ -285,7 +285,7 @@
"""An option to select something from a list."""
def __init__(self, sequence, prefix=''):
- """Constructor."""
+ """Initializer."""
self._list = sequence
try:
super(ListOption, self).__init__(1, self.maximum, prefix)
diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py
index c75e968..2aedc7b 100644
--- a/pywikibot/botirc.py
+++ b/pywikibot/botirc.py
@@ -7,7 +7,7 @@
"""
#
# (C) Balasyum, 2008
-# (C) Pywikibot team, 2008-2015
+# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
@@ -57,7 +57,7 @@
}
def __init__(self, site, channel, nickname, server, port=6667, **kwargs):
- """Constructor."""
+ """Initializer."""
pywikibot.Bot.__init__(self, **kwargs)
SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname)
self.channel = channel
diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 0b790b3..7731d5b 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -76,7 +76,7 @@
"""
def __init__(self, **kwargs):
- """Constructor.
+ """Initializer.
@keyword site: a project site object. Used when no url is given
@type site: APISite
diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index 7bab2f0..a2b9940 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -39,7 +39,7 @@
def __init__(self, uri, method="GET", params=None, body=None,
headers=None,
callbacks=None, charset=None, **kwargs):
"""
- Constructor.
+ Initializer.
See C{Http.request} for parameters.
"""
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index c52042c..3699445 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -230,7 +230,7 @@
@deprecated_args(debug='diff', redirect=None)
def __init__(self, site, diff=False, namespace=None, pageTitle=None,
ignore=CANCEL_ALL):
- """Constructor."""
+ """Initializer."""
self.site = site
self.diff = diff
try:
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c305dda..4e677cb 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -60,7 +60,7 @@
"""Workaround for bug in python 3 email handling of CTE
binary."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(CTEBinaryBytesGenerator, self).__init__(*args, **kwargs)
self._writeBody = self._write_body
@@ -194,7 +194,7 @@
def __init__(self, site, preloaded_modules=None, modules_only_mode=None):
"""
- Constructor.
+ Initializer.
@param preloaded_modules: API modules to preload
@type preloaded_modules: set of string
@@ -1056,7 +1056,7 @@
def __init__(self, site=None, module=None, param=None, dict=None):
"""
- Constructor.
+ Initializer.
If a site is given, the module and param must be given too.
@@ -1235,7 +1235,7 @@
"""Wrapper to change the site protocol to https."""
def __init__(self, site):
- """Constructor."""
+ """Initializer."""
self._site = site
def __repr__(self):
@@ -1498,8 +1498,8 @@
Convert keyword arguments into new parameters mode.
If there are no other arguments in kwargs apart from the used arguments
- by the class' constructor it'll just return kwargs and otherwise remove
- those which aren't in the constructor and put them in a dict which is
+ by the class' initializer it'll just return kwargs and otherwise remove
+ those which aren't in the initializer and put them in a dict which is
added as a 'parameters' keyword. It will always create a shallow copy.
@param kwargs: The original keyword arguments which is not modified.
@@ -2232,7 +2232,7 @@
"""Cached request."""
def __init__(self, expiry, *args, **kwargs):
- """Construct a CachedRequest object.
+ """Initialize a CachedRequest object.
@param expiry: either a number of days or a datetime.timedelta object
"""
@@ -2404,7 +2404,7 @@
def __init__(self, action, continue_name='continue',
limit_name='limit',
data_name='data', **kwargs):
"""
- Construct an APIGenerator object.
+ Initialize an APIGenerator object.
kwargs are used to create a Request object; see that object's
documentation for values.
@@ -2536,7 +2536,7 @@
def __init__(self, **kwargs):
"""
- Construct a QueryGenerator object.
+ Initialize a QueryGenerator object.
kwargs are used to create a Request object; see that object's
documentation for values. 'action'='query' is assumed.
@@ -2911,7 +2911,7 @@
def __init__(self, generator, g_content=False, **kwargs):
"""
- Constructor.
+ Initializer.
Required and optional parameters are as for C{Request}, except that
action=query is assumed and generator is required.
@@ -3001,7 +3001,7 @@
def __init__(self, prop, **kwargs):
"""
- Constructor.
+ Initializer.
Required and optional parameters are as for C{Request}, except that
action=query is assumed and prop is required.
@@ -3039,7 +3039,7 @@
def __init__(self, listaction, **kwargs):
"""
- Constructor.
+ Initializer.
Required and optional parameters are as for C{Request}, except that
action=query is assumed and listaction is required.
@@ -3061,7 +3061,7 @@
"""
def __init__(self, logtype=None, **kwargs):
- """Constructor."""
+ """Initializer."""
ListGenerator.__init__(self, "logevents", **kwargs)
from pywikibot import logentries
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index f33b117..2ed1447 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -85,7 +85,7 @@
ALL_KEYS = set(FAMILY_MAPPING.keys()) | ALL_TABLES
def __init__(self,
url='https://wikistats.wmflabs.org/')g/'):
- """Constructor."""
+ """Initializer."""
self.url = url
self._raw = {}
self._data = {}
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 057f56c..47e8200 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -2348,7 +2348,7 @@
"""Format a date."""
def __init__(self, site):
- """Constructor."""
+ """Initializer."""
self.site = site
def __call__(self, m, d):
diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 52a92c8..1b199f3 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -39,7 +39,7 @@
def __init__(self, a, b, grouped_opcode):
"""
- Constructor.
+ Initializer.
@param a: sequence of lines
@param b: sequence of lines
@@ -254,7 +254,7 @@
@deprecated_args(n='context')
def __init__(self, text_a, text_b, context=0, by_letter=False,
replace_invisible=False):
- """Constructor.
+ """Initializer.
@param text_a: base text
@type text_a: basestring
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index ba311ed..a66be12 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Classes and functions for working with the Echo
extension."""
#
-# (C) Pywikibot team, 2014-2016
+# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
#
@@ -15,7 +15,7 @@
"""A notification issued by the Echo extension."""
def __init__(self, site):
- """Construct an empty Notification object."""
+ """Initialize an empty Notification object."""
self.site = site
@classmethod
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index 07d47b7..9d93dbd 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -124,7 +124,7 @@
# NOTE: UnicodeMixin must be the first object Error class is derived from.
def __init__(self, arg):
- """Constructor."""
+ """Initializer."""
self.unicode = arg
def __unicode__(self):
@@ -148,7 +148,7 @@
def __init__(self, page, message=None):
"""
- Constructor.
+ Initializer.
@param page: Page that caused the exception
@type page: Page object
@@ -197,7 +197,7 @@
message = "Edit to page %(title)s failed:\n%(reason)s"
def __init__(self, page, reason):
- """Constructor.
+ """Initializer.
@param reason: Details of the problem
@type reason: Exception or basestring
@@ -258,7 +258,7 @@
"""Page receives a title inconsistent with query."""
def __init__(self, page, actual):
- """Constructor.
+ """Initializer.
@param page: Page that caused the exception
@type page: Page object
@@ -349,7 +349,7 @@
u"Target page: %(target_page)s on %(target_site)s.")
def __init__(self, page, target_page):
- """Constructor.
+ """Initializer.
@param target_page: Target page of the redirect.
@type reason: Page
@@ -457,7 +457,7 @@
'content:\n%(url)s')
def __init__(self, page, url):
- """Constructor."""
+ """Initializer."""
self.url = url
super(SpamfilterError, self).__init__(page)
diff --git a/pywikibot/family.py b/pywikibot/family.py
index e5513c0..6565361 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1500,7 +1500,7 @@
"""Single site family."""
def __new__(cls):
- """Constructor."""
+ """Initializer."""
if not hasattr(cls, 'code'):
cls.code = cls.name
@@ -1525,7 +1525,7 @@
"""Multi site wikis that are subdomains of the same top level
domain."""
def __new__(cls):
- """Constructor."""
+ """Initializer."""
assert cls.domain
return super(SubdomainFamily, cls).__new__(cls)
diff --git a/pywikibot/flow.py b/pywikibot/flow.py
index a559787..35b67d1 100644
--- a/pywikibot/flow.py
+++ b/pywikibot/flow.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Objects representing Flow entities, like boards, topics, and
posts."""
#
-# (C) Pywikibot team, 2015
+# (C) Pywikibot team, 2015-2018
#
# Distributed under the terms of the MIT license.
#
@@ -37,7 +37,7 @@
"""
def __init__(self, source, title=''):
- """Constructor.
+ """Initializer.
@param source: A Flow-enabled site or a Link or Page on such a site
@type source: Site, Link, or Page
@@ -313,7 +313,7 @@
def __init__(self, page, uuid):
"""
- Constructor.
+ Initializer.
@param page: Flow topic
@type page: Topic
diff --git a/pywikibot/interwiki_graph.py b/pywikibot/interwiki_graph.py
index 00166ed..dcff1cd 100644
--- a/pywikibot/interwiki_graph.py
+++ b/pywikibot/interwiki_graph.py
@@ -43,7 +43,7 @@
"""
def __init__(self, graph, originPage):
- """Constructor."""
+ """Initializer."""
threading.Thread.__init__(self)
self.graph = graph
self.originPage = originPage
@@ -64,7 +64,7 @@
"""Data about a page with translations on multiple
wikis."""
def __init__(self, origin=None):
- """Constructor.
+ """Initializer.
@param originPage: the page on the 'origin' wiki
@type originPage: Page
@@ -133,7 +133,7 @@
"""Graphviz (dot) code creator."""
def __init__(self, subject):
- """Constructor.
+ """Initializer.
@param subject: page data to graph
@type subject: Subject
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 01f2246..d0a93be 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -187,7 +187,7 @@
_expectedType = 'block'
def __init__(self, apidata, site):
- """Constructor."""
+ """Initializer."""
super(BlockEntry, self).__init__(apidata, site)
# When an autoblock is removed, the "title" field is not a page title
# See bug T19781
@@ -435,7 +435,7 @@
def __init__(self, site, logtype=None):
"""
- Constructor.
+ Initializer.
@param site: The site on which the log entries are created.
@type site: BaseSite
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 88e52bc..2780dbc 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -65,7 +65,7 @@
@deprecated_args(username="user", verbose=None)
def __init__(self, password=None, sysop=False, site=None, user=None):
"""
- Constructor.
+ Initializer.
All parameters default to defaults in user-config.
@@ -358,7 +358,7 @@
def __init__(self, suffix, password):
"""
- Constructor.
+ Initializer.
BotPassword function by using a separate password paired with a suffixed
username of the form <username>@<suffix>.
@@ -396,7 +396,7 @@
def __init__(self, password=None, sysop=False, site=None, user=None):
"""
- Constructor.
+ Initializer.
All parameters default to defaults in user-config.
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 14d1db2..a132194 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -206,8 +206,8 @@
self._revisions = {}
else:
raise pywikibot.Error(
- "Invalid argument type '%s' in Page constructor: %s"
- % (type(source), source))
+ "Invalid argument type '{}' in Page initializer: {}"
+ .format(type(source), source))
@property
def site(self):
@@ -2400,7 +2400,7 @@
@deprecate_arg("insite", None)
def __init__(self, source, title=u""):
- """Constructor."""
+ """Initializer."""
self._file_revisions = {} # dictionary to cache File history.
super(FilePage, self).__init__(source, title, 6)
if self.namespace() != 6:
@@ -2729,9 +2729,9 @@
@deprecate_arg("insite", None)
def __init__(self, source, title=u"", sortKey=None):
"""
- Constructor.
+ Initializer.
- All parameters are the same as for Page() constructor.
+ All parameters are the same as for Page() Initializer.
"""
self.sortKey = sortKey
Page.__init__(self, source, title, ns=14)
@@ -3160,7 +3160,7 @@
"""
Initializer for a User object.
- All parameters are the same as for Page() constructor.
+ All parameters are the same as for Page() Initializer.
"""
self._isAutoblock = True
if title.startswith('#'):
@@ -3642,7 +3642,7 @@
def __init__(self, site, title=u"", **kwargs):
"""
- Constructor.
+ Initializer.
If title is provided, either ns or entity_type must also be provided,
and will be checked against the title parsed using the Page
@@ -4225,7 +4225,7 @@
def __init__(self, site, title=None, ns=None):
"""
- Constructor.
+ Initializer.
@param site: data repository
@type site: pywikibot.site.DataSite
@@ -4648,7 +4648,7 @@
def __init__(self, site, id, datatype=None):
"""
- Constructor.
+ Initializer.
@param site: data repository
@type site: pywikibot.site.DataSite
@@ -4716,7 +4716,7 @@
def __init__(self, source, title=u""):
"""
- Constructor.
+ Initializer.
@param source: data repository property is on
@type source: pywikibot.site.DataSite
@@ -4791,7 +4791,7 @@
def __init__(self, site, pid, snak=None, hash=None, isReference=False,
isQualifier=False, **kwargs):
"""
- Constructor.
+ Initializer.
Defined by the "snak" value, supplemented by site + pid
@@ -5255,7 +5255,7 @@
text=None, minor=False, rollbacktoken=None, parentid=None,
contentmodel=None, sha1=None):
"""
- Constructor.
+ Initializer.
All parameters correspond to object attributes (e.g., revid
parameter is stored as self.revid)
@@ -5436,7 +5436,7 @@
def __init__(self, text, source=None, defaultNamespace=0):
"""
- Constructor.
+ Initializer.
@param text: the link text (everything appearing between [[ and ]]
on a wiki page)
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index c1a3187..108c434 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -411,7 +411,7 @@
def __init__(self, site=None, positional_arg_name=None):
"""
- Constructor.
+ Initializer.
@param site: Site for generator results.
@type site: L{pywikibot.site.BaseSite}
@@ -444,7 +444,7 @@
arguments have been handled, otherwise the default Site may be changed
by global arguments, which will cause this cached value to be stale.
- @return: Site given to constructor, otherwise the default Site at the
+ @return: Site given to initializer, otherwise the default Site at the
time this property is first accessed.
@rtype: L{pywikibot.site.BaseSite}
"""
@@ -2534,7 +2534,7 @@
@deprecated_args(count='total')
def __init__(self, query=None, total=100, site=None):
"""
- Constructor.
+ Initializer.
@param site: Site for generator results.
@type site: L{pywikibot.site.BaseSite}
@@ -2597,7 +2597,7 @@
def __init__(self, query=None, site=None):
"""
- Constructor.
+ Initializer.
@param site: Site for generator results.
@type site: L{pywikibot.site.BaseSite}
@@ -2722,7 +2722,7 @@
@deprecated_args(xmlFilename='filename', xmlStart='start')
def __init__(self, filename, start=None, namespaces=None, site=None,
text_predicate=None):
- """Constructor."""
+ """Initializer."""
self.text_predicate = text_predicate
self.skipping = bool(start)
@@ -2915,7 +2915,7 @@
def __init__(self, categories, subset_combination=True, namespaces=None,
site=None, extra_options=None):
"""
- Constructor.
+ Initializer.
:param categories: List of categories to retrieve pages from
(as strings)
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index a1431cd..0824117 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -62,7 +62,7 @@
'{0.header}')
def __init__(self, text=None):
- """Constructor."""
+ """Initializer."""
self._text = text or ''
self._has_div = True
@@ -649,7 +649,7 @@
"""
def __init__(self, **kwargs):
- """Monkeypatch action in Request constructor."""
+ """Monkeypatch action in Request initializer."""
action = kwargs['parameters']['action']
kwargs['parameters']['action'] = 'dummy'
super(PurgeRequest, self).__init__(**kwargs)
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 6e847c4..47b14a2 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -128,7 +128,7 @@
% search_value)
def __init__(self, state):
- """Constructor."""
+ """Initializer."""
self.state = state
def __repr__(self):
@@ -209,7 +209,7 @@
def __init__(self, id, canonical_name=None, custom_name=None,
aliases=None, use_image_name=False, **kwargs):
- """Constructor.
+ """Initializer.
@param custom_name: Name defined in server LocalSettings.php
@type custom_name: unicode
@@ -719,7 +719,7 @@
def __init__(self, code, fam=None, user=None, sysop=None):
"""
- Constructor.
+ Initializer.
@param code: the site's language code
@type code: str
@@ -1729,7 +1729,7 @@
"""Container for tokens."""
def __init__(self, site):
- """Constructor."""
+ """Initializer."""
self.site = site
self._tokens = {}
self.failed_cache = set() # cache unavailable tokens.
@@ -1805,7 +1805,7 @@
"""Site removed from a family."""
def __init__(self, code, fam, user=None, sysop=None):
- """Constructor."""
+ """Initializer."""
super(RemovedSite, self).__init__(code, fam, user, sysop)
@@ -1814,7 +1814,7 @@
"""API interface to non MediaWiki sites."""
def __init__(self, url):
- """Constructor."""
+ """Initializer."""
self.netloc = urlparse(url).netloc
def __getattribute__(self, attr):
@@ -1837,7 +1837,7 @@
"""
def __init__(self, code, fam=None, user=None, sysop=None):
- """Constructor."""
+ """Initializer."""
BaseSite.__init__(self, code, fam, user, sysop)
self._msgcache = {}
self._loginstatus = LoginStatus.NOT_ATTEMPTED
@@ -1905,7 +1905,7 @@
All generic keyword arguments are passed as MW API parameter except for
'g_content' which is passed as a normal parameter to the generator's
- constructor.
+ Initializer.
@param gen_class: the type of generator to construct (must be
a subclass of pywikibot.data.api.QueryGenerator)
@@ -7343,7 +7343,7 @@
"""Wikibase data capable site."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(DataSite, self).__init__(*args, **kwargs)
self._item_namespace = None
self._property_namespace = None
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index 534c813..f1a0bfc 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -47,7 +47,7 @@
def __init__(self, fromurl):
"""
- Constructor.
+ Initializer.
@raises ServerError: a server error occurred while loading the site
@raises Timeout: a timeout occurred while loading the site
@@ -231,7 +231,7 @@
"""Wiki HTML page parser."""
def __init__(self, url):
- """Constructor."""
+ """Initializer."""
if PYTHON_VERSION < (3, 4):
HTMLParser.__init__(self)
else:
diff --git a/pywikibot/specialbots.py b/pywikibot/specialbots.py
index 12adfbd..5d7568d 100644
--- a/pywikibot/specialbots.py
+++ b/pywikibot/specialbots.py
@@ -47,7 +47,7 @@
ignoreWarning=False, targetSite=None, aborts=[], chunk_size=0,
summary=None, filename_prefix=None, **kwargs):
"""
- Constructor.
+ Initializer.
@param url: path to url or local file (deprecated), or list of urls or
paths to local files.
@@ -490,7 +490,7 @@
"""The text should be edited and replacement should be
restarted."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
super(EditReplacement, self).__init__('edit', 'e')
self.stop = True
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9180a35..a102256 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -197,7 +197,7 @@
"""Build template matcher."""
def __init__(self, site):
- """Constructor."""
+ """Initializer."""
self.site = site
def pattern(self, template, flags=re.DOTALL):
@@ -1907,7 +1907,7 @@
"""
def __init__(self, offset, name):
- """Constructor."""
+ """Initializer."""
self.__offset = datetime.timedelta(minutes=offset)
self.__name = name
@@ -1937,7 +1937,7 @@
"""Find timestamp in page and return it as pywikibot.Timestamp
object."""
def __init__(self, site=None):
- """Constructor."""
+ """Initializer."""
if site is None:
self.site = pywikibot.Site()
else:
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index abba04f..e6236ff 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -39,7 +39,7 @@
def __init__(self, site, mindelay=None, maxdelay=None, writedelay=None,
multiplydelay=True):
- """Constructor."""
+ """Initializer."""
self.lock = threading.RLock()
self.mysite = str(site)
self.ctrlfilename = config.datafilepath('throttle.ctrl')
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 9a7f1ff..a01b241 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -96,7 +96,7 @@
"""No implementation is available."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
raise NotImplementedError(
'%s: %s' % (self.__class__.__name__, self.__doc__))
@@ -295,7 +295,7 @@
def __init__(self, data=None, error=None):
"""
- Constructor.
+ Initializer.
@param data: mapping to freeze
@type data: mapping
@@ -349,7 +349,7 @@
def __init__(self, pattern, flags=0):
"""
- Constructor.
+ Initializer.
@param pattern: L{re} regex pattern
@type pattern: str or callable
@@ -406,7 +406,7 @@
def __init__(self, pattern, flags=0, name=None, instead=None):
"""
- Constructor.
+ Initializer.
If name is None, the regex pattern will be used as part of
the deprecation warning.
@@ -572,7 +572,7 @@
def __init__(self, group=None, target=None, name="GeneratorThread",
args=(), kwargs=None, qsize=65536):
- """Constructor. Takes same keyword arguments as threading.Thread.
+ """Initializer. Takes same keyword arguments as threading.Thread.
target must be a generator function (or other callable that returns
an iterable object).
@@ -727,7 +727,7 @@
_logger = "threadlist"
def __init__(self, limit=128, *args):
- """Constructor."""
+ """Initializer."""
self.limit = limit
super(ThreadList, self).__init__(*args)
for item in self:
diff --git a/pywikibot/tools/_logging.py b/pywikibot/tools/_logging.py
index 36d856d..715fbcb 100644
--- a/pywikibot/tools/_logging.py
+++ b/pywikibot/tools/_logging.py
@@ -82,7 +82,7 @@
record.args = (msg,)
text = logging.handlers.RotatingFileHandler.format(self, record)
- return text.rstrip("\r\n")
+ return text.rstrip()
class LoggingFormatter(logging.Formatter):
@@ -96,7 +96,7 @@
"""
def __init__(self, fmt=None, datefmt=None, encoding=None):
- """Constructor with additional encoding
parameter."""
+ """Initializer with additional encoding
parameter."""
logging.Formatter.__init__(self, fmt, datefmt)
self._encoding = encoding
diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py
index 7f4e66e..7f88894 100644
--- a/pywikibot/tools/djvu.py
+++ b/pywikibot/tools/djvu.py
@@ -74,7 +74,7 @@
@deprecated_args(file_djvu='file')
def __init__(self, file):
"""
- Constructor.
+ Initializer.
@param file: filename (including path) to djvu file
@type file: string/unicode
diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py
index eae12bb..32b2d58 100644
--- a/pywikibot/userinterfaces/gui.py
+++ b/pywikibot/userinterfaces/gui.py
@@ -57,7 +57,7 @@
def __init__(self, master=None, **kwargs):
"""
- Constructor.
+ Initializer.
Get default settings from user's IDLE configuration.
"""
@@ -269,7 +269,7 @@
"""Edit box window."""
def __init__(self, parent=None, **kwargs):
- """Constructor."""
+ """Initializer."""
if parent is None:
# create a new window
parent = Tkinter.Tk()
@@ -493,7 +493,7 @@
"""The dialog window for image info."""
def __init__(self, photo_description, photo, filename):
- """Constructor."""
+ """Initializer."""
self.root = Tkinter.Tk()
# "%dx%d%+d%+d" % (width, height, xoffset, yoffset)
self.root.geometry("%ix%i+10-10" % (pywikibot.config.tkhorsize,
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py
b/pywikibot/userinterfaces/terminal_interface_base.py
index 9eba2fd..f68475d 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -535,7 +535,7 @@
"""
def __init__(self, level=None):
- """Constructor."""
+ """Initializer."""
self.level = level
def filter(self, record):
diff --git a/pywikibot/userinterfaces/terminal_interface_win32.py
b/pywikibot/userinterfaces/terminal_interface_win32.py
index ed0a89c..51a86ff 100755
--- a/pywikibot/userinterfaces/terminal_interface_win32.py
+++ b/pywikibot/userinterfaces/terminal_interface_win32.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""User interface for Win32 terminals."""
#
-# (C) Pywikibot team, 2003-2016
+# (C) Pywikibot team, 2003-2018
#
# Distributed under the terms of the MIT license.
#
@@ -45,7 +45,7 @@
"""User interface for Win32 terminals without
ctypes."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
terminal_interface_base.UI.__init__(self)
self.encoding = 'ascii'
@@ -55,7 +55,7 @@
"""User interface for Win32 terminals using ctypes."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
Win32BaseUI.__init__(self)
(stdin, stdout, stderr, argv) = win32_unicode.get_unicode_console()
self.stdin = stdin
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py
index fefaa90..39b5d7c 100644
--- a/pywikibot/xmlreader.py
+++ b/pywikibot/xmlreader.py
@@ -9,7 +9,7 @@
XmlEntry objects which can be used by other bots.
"""
#
-# (C) Pywikibot team, 2005-2013
+# (C) Pywikibot team, 2005-2018
#
# Distributed under the terms of the MIT license.
#
@@ -55,7 +55,7 @@
def __init__(self, title, ns, id, text, username, ipedit, timestamp,
editRestriction, moveRestriction, revisionid, comment,
redirect):
- """Constructor."""
+ """Initializer."""
# TODO: there are more tags we can read.
self.title = title
self.ns = ns
@@ -84,7 +84,7 @@
"""
def __init__(self, filename, handler):
- """Constructor."""
+ """Initializer."""
threading.Thread.__init__(self)
self.filename = filename
self.handler = handler
@@ -108,7 +108,7 @@
"""
def __init__(self, filename, allrevisions=False):
- """Constructor."""
+ """Initializer."""
self.filename = filename
if allrevisions:
self._parse = self._parse_all
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index b303647..471fca9 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -353,7 +353,7 @@
"""
def __init__(self, title, now, timestripper):
- """Constructor."""
+ """Initializer."""
self.title = title
self.now = now
self.ts = timestripper
@@ -422,7 +422,7 @@
"""
def __init__(self, source, archiver, params=None):
- """Constructor."""
+ """Initializer."""
super(DiscussionPage, self).__init__(source)
self.threads = []
self.full = False
@@ -544,7 +544,7 @@
algo = 'none'
def __init__(self, page, tpl, salt, force=False):
- """Constructor."""
+ """Initializer."""
self.attributes = {
'algo': ['old(24h)', False],
'archive': ['', False],
diff --git a/scripts/basic.py b/scripts/basic.py
index befec04..db0402f 100755
--- a/scripts/basic.py
+++ b/scripts/basic.py
@@ -70,7 +70,7 @@
def __init__(self, generator, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: the page generator that determines on which pages
to work
@@ -85,7 +85,7 @@
'top': False, # append text on top of the page
})
- # call constructor of the super class
+ # call initializer of the super class
super(BasicBot, self).__init__(site=True, **kwargs)
# handle old -dry parameter
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py
index 0ce8da7..e967185 100755
--- a/scripts/capitalize_redirects.py
+++ b/scripts/capitalize_redirects.py
@@ -22,7 +22,7 @@
"""
#
# (C) Yrithinnd, 2006
-# (C) Pywikibot team, 2007-2017
+# (C) Pywikibot team, 2007-2018
#
# Distributed under the terms of the MIT license.
#
@@ -49,7 +49,7 @@
"""Capitalization Bot."""
def __init__(self, generator, **kwargs):
- """Constructor.
+ """Initializer.
Parameters:
@param generator: The page generator that determines on which pages
diff --git a/scripts/casechecker.py b/scripts/casechecker.py
index 92aa7a6..07caf72 100755
--- a/scripts/casechecker.py
+++ b/scripts/casechecker.py
@@ -88,7 +88,7 @@
filterredir = 'nonredirects'
def __init__(self):
- """Constructor with arg parsing."""
+ """Initializer with arg parsing."""
for arg in pywikibot.handle_args():
arg, sep, value = arg.partition(':')
if arg == '-from':
diff --git a/scripts/category.py b/scripts/category.py
index 09faef2..b4fe075 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -174,7 +174,7 @@
def __init__(self, page, follow_redirects=False, edit_redirects=False,
create=False):
- """Constructor."""
+ """Initializer."""
super(CategoryPreprocess, self).__init__()
page = page
self.follow_redirects = follow_redirects
@@ -283,7 +283,7 @@
"""
def __init__(self, rebuild=False, filename='category.dump.bz2'):
- """Constructor."""
+ """Initializer."""
if not os.path.isabs(filename):
filename = config.datafilepath(filename)
self.filename = filename
@@ -406,7 +406,7 @@
@deprecated_args(editSummary='comment', dry=None)
def __init__(self, generator, newcat=None, sort_by_last_name=False,
create=False, comment='', follow_redirects=False):
- """Constructor."""
+ """Initializer."""
super(CategoryAddBot, self).__init__()
self.generator = generator
self.newcat = newcat
@@ -885,7 +885,7 @@
self, catTitle, batchMode=False, editSummary='',
useSummaryForDeletion=CategoryMoveRobot.DELETION_COMMENT_AUTOMATIC,
titleRegex=None, inPlace=False, pagesonly=False):
- """Constructor."""
+ """Initializer."""
super(CategoryRemoveRobot, self).__init__(
oldcat=catTitle,
batch=batchMode,
@@ -903,7 +903,7 @@
def __init__(self, catTitle, listTitle, editSummary, overwrite=False,
showImages=False, subCats=False, talkPages=False,
recurse=False):
- """Constructor."""
+ """Initializer."""
self.editSummary = editSummary
self.overwrite = overwrite
self.showImages = showImages
@@ -971,7 +971,7 @@
"""
def __init__(self, catTitle, catDB, namespaces=None):
- """Constructor."""
+ """Initializer."""
self.catTitle = catTitle
self.catDB = catDB
site = pywikibot.Site()
@@ -999,7 +999,7 @@
"""An option to show more and more context."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
super(CatContextOption, self).__init__(
'print first part of the page (longer and longer)',
'?',
full_text, contextLength, 500)
@@ -1136,7 +1136,7 @@
"""
def __init__(self, catTitle, catDB, filename=None, maxDepth=10):
- """Constructor."""
+ """Initializer."""
self.catTitle = catTitle
self.catDB = catDB
if filename and not os.path.isabs(filename):
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index 4040eaf..dbe9da2 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -50,7 +50,7 @@
"""Page category update bot."""
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'tiny': False, # use Non-empty category redirects only
'delay': 7, # cool down delay in days
diff --git a/scripts/cfd.py b/scripts/cfd.py
index 9b3b293..f19a279 100755
--- a/scripts/cfd.py
+++ b/scripts/cfd.py
@@ -59,7 +59,7 @@
"""Helper class."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
self.result = None
def check(self, pattern, text):
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 44a14af..1ff5df0 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -549,8 +549,9 @@
"""A robot to check recently uploaded files."""
def __init__(self, site, logFulNumber=25000, sendemailActive=False,
- duplicatesReport=False, logFullError=True, max_user_notify=None):
- """Constructor, define some global variable."""
+ duplicatesReport=False, logFullError=True,
+ max_user_notify=None):
+ """Initializer, define some instance variables."""
self.site = site
self.logFullError = logFullError
self.logFulNumber = logFulNumber
diff --git a/scripts/claimit.py b/scripts/claimit.py
index caf75ec..300076d 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -48,7 +48,7 @@
"""
#
# (C) Legoktm, 2013
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of the MIT license.
#
@@ -72,7 +72,7 @@
def __init__(self, generator, claims, exists_arg=''):
"""
- Constructor.
+ Initializer.
@param generator: A generator that yields Page objects.
@type generator: iterator
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index afb35a5..541e1e6 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -29,9 +29,9 @@
# (C) Wikipedian, 2006-2007
# (C) Andre Engels, 2007
# (C) Siebrand Mazeland, 2007
-# (C) xqt, 2009-2017
+# (C) xqt, 2009-2018
# (C) Dr. Trigon, 2012
-# (C) Pywikibot team, 2012-2017
+# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
@@ -132,7 +132,7 @@
}
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
super(SandboxBot, self).__init__(**kwargs)
if self.getOption('delay') is None:
d = min(15, max(5, int(self.getOption('hours') * 60)))
diff --git a/scripts/commons_link.py b/scripts/commons_link.py
index 61c0278..e5664dd 100755
--- a/scripts/commons_link.py
+++ b/scripts/commons_link.py
@@ -24,7 +24,7 @@
"""
#
# (C) Leonardo Gregianin, 2006
-# (C) Pywikibot team, 2007-2017
+# (C) Pywikibot team, 2007-2018
#
# Distributed under the terms of the MIT license.
#
@@ -49,7 +49,7 @@
"""Commons linking bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'action': None,
})
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index e1c37df..5ccddad 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -230,7 +230,7 @@
"""Commons categorisation bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'summary': None,
})
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 8431b05..fce00a5 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -29,7 +29,7 @@
"""
#
# (C) Multichill, 2014
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of MIT License.
#
@@ -48,7 +48,7 @@
def __init__(self, generator, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: A generator that yields Page objects.
"""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 6af8259..af91233 100644
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -26,8 +26,8 @@
For further information see pywikibot/cosmetic_changes.py
"""
#
-# (C) xqt, 2009-2017
-# (C) Pywikibot team, 2006-2017
+# (C) xqt, 2009-2018
+# (C) Pywikibot team, 2006-2018
#
# Distributed under the terms of the MIT license.
#
@@ -56,7 +56,7 @@
"""Cosmetic changes bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'async': False,
'summary': u'Robot: Cosmetic changes',
diff --git a/scripts/create_categories.py b/scripts/create_categories.py
index a9871c1..96ba438 100755
--- a/scripts/create_categories.py
+++ b/scripts/create_categories.py
@@ -32,8 +32,8 @@
"""
#
# (C) Multichill, 2011
-# (C) xqt, 2011-2016
-# (c) Pywikibot team, 2017
+# (C) xqt, 2011-2018
+# (c) Pywikibot team, 2018
#
# Distributed under the terms of the MIT license.
#
@@ -48,7 +48,7 @@
"""Category creator bot."""
def __init__(self, generator, parent, basename, **kwargs):
- """Constructor."""
+ """Initializer."""
super(CreateCategoriesBot, self).__init__(**kwargs)
self.generator = generator
self.parent = parent
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index 198b55c..9731f76 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -8,7 +8,7 @@
python pwb.py data_ingestion -csvdir:local_dir/ -page:config_page
"""
#
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of the MIT license.
#
@@ -46,7 +46,7 @@
def __init__(self, URL, metadata, site=None):
"""
- Constructor.
+ Initializer.
@param URL: URL of photo
@type URL: str
@@ -149,7 +149,7 @@
def __init__(self, reader, titlefmt, pagefmt,
site='deprecated_default_commons'):
"""
- Constructor.
+ Initializer.
@param reader: Generator of Photos to process.
@type reader: Photo page generator
diff --git a/scripts/delete.py b/scripts/delete.py
index 4e197a4..925fbcc 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -84,7 +84,7 @@
"""
def __init__(self, source, title='', ns=0):
- """Constructor."""
+ """Initializer."""
super(PageWithRefs, self).__init__(source, title, ns)
_cache_attrs = list(super(PageWithRefs, self)._cache_attrs)
_cache_attrs = tuple(_cache_attrs + ['_ref_table'])
@@ -132,7 +132,7 @@
def __init__(self, generator, summary, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: the pages to work on
@type generator: iterable
diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index 87b4e83..8d20297 100644
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -28,7 +28,7 @@
"""
#
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
@@ -55,7 +55,7 @@
def __init__(self, djvu, index, pages=None, **kwargs):
"""
- Constructor.
+ Initializer.
@param djvu: djvu from where to fetch the text layer
@type djvu: DjVuFile object
diff --git a/scripts/editarticle.py b/scripts/editarticle.py
index b7077ac..49a389a 100755
--- a/scripts/editarticle.py
+++ b/scripts/editarticle.py
@@ -46,7 +46,7 @@
"""Edit a wiki page."""
def __init__(self, *args):
- """Constructor."""
+ """Initializer."""
self.set_options(*args)
self.site = pywikibot.Site()
self.setpage()
diff --git a/scripts/followlive.py b/scripts/followlive.py
index 5f7e3a2..ca190ee 100644
--- a/scripts/followlive.py
+++ b/scripts/followlive.py
@@ -386,7 +386,7 @@
"""Bot meant to facilitate customized cleaning of the
page."""
def __init__(self, questions, questionlist, **kwargs):
- """Constructor."""
+ """Initializer."""
# The question asked
self.question = """(multiple numbers delimited with ',')
diff --git a/scripts/freebasemappingupload.py b/scripts/freebasemappingupload.py
index 29f5054..07a40ed 100755
--- a/scripts/freebasemappingupload.py
+++ b/scripts/freebasemappingupload.py
@@ -15,7 +15,7 @@
"""
#
# (C) Denny Vrandecic, 2013
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of the MIT license.
#
@@ -33,7 +33,7 @@
"""Freebase Mapping bot."""
def __init__(self, filename):
- """Constructor."""
+ """Initializer."""
self.repo = pywikibot.Site('wikidata',
'wikidata').data_repository()
self.filename = filename
if not os.path.exists(self.filename):
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 7014f85..2db474e 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -78,7 +78,7 @@
"""
#
# (C) Multichill, Amir, 2013
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of MIT License.
#
@@ -125,7 +125,7 @@
def __init__(self, generator, templateTitle, fields, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: A generator that yields Page objects
@type generator: iterator
diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
index 9056295..484838a 100755
--- a/scripts/illustrate_wikidata.py
+++ b/scripts/illustrate_wikidata.py
@@ -15,7 +15,7 @@
"""
#
# (C) Multichill, 2014
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of MIT License.
#
@@ -34,7 +34,7 @@
def __init__(self, generator, wdproperty=u'P18'):
"""
- Constructor.
+ Initializer.
@param generator: A generator that yields Page objects
@type generator: generator
diff --git a/scripts/image.py b/scripts/image.py
index b3315b0..bfe5ee9 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -38,7 +38,7 @@
"""
#
-# (C) Pywikibot team, 2013-2017
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of the MIT license.
#
@@ -59,7 +59,7 @@
def __init__(self, generator, old_image, new_image=None, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: the pages to work on
@type generator: iterable
diff --git a/scripts/imagecopy.py b/scripts/imagecopy.py
index 6fd6fe4..09484f1 100644
--- a/scripts/imagecopy.py
+++ b/scripts/imagecopy.py
@@ -240,7 +240,7 @@
"""Facilitate transfer of image/file to commons."""
def __init__(self, imagePage, newname, category, delete_after_done=False):
- """Constructor."""
+ """Initializer."""
self.imagePage = imagePage
self.image_repo = imagePage.site.image_repository()
self.newname = newname
@@ -393,7 +393,7 @@
def __init__(self, image_title, content, uploader, url, templates,
commonsconflict=0):
- """Constructor."""
+ """Initializer."""
# Check if `Tkinter` wasn't imported
if isinstance(Tkinter, ImportError):
raise Tkinter
diff --git a/scripts/imagecopy_self.py b/scripts/imagecopy_self.py
index 6ed5e7f..c1f91cc 100644
--- a/scripts/imagecopy_self.py
+++ b/scripts/imagecopy_self.py
@@ -337,7 +337,7 @@
"""Tries to fetch information for all images in the
generator."""
def __init__(self, pagegenerator, prefetchQueue):
- """Constructor."""
+ """Initializer."""
self.pagegenerator = pagegenerator
self.prefetchQueue = prefetchQueue
imagerecat.initLists()
@@ -619,7 +619,7 @@
"""Prompt all images to the user."""
def __init__(self, prefetchQueue, uploadQueue):
- """Constructor."""
+ """Initializer."""
self.prefetchQueue = prefetchQueue
self.uploadQueue = uploadQueue
self.autonomous = False
@@ -683,13 +683,13 @@
"""The dialog window for image info."""
def __init__(self, fields):
- """Constructor.
+ """Initializer.
fields:
imagepage, description, date, source, author, licensetemplate,
categories
"""
- """Constructor."""
+ """Initializer."""
# Check if `Tkinter` wasn't imported
if isinstance(Tkinter, ImportError):
raise Tkinter
@@ -869,7 +869,7 @@
"""Upload all images."""
def __init__(self, uploadQueue):
- """Constructor."""
+ """Initializer."""
self.uploadQueue = uploadQueue
self.checktemplate = True
threading.Thread.__init__(self)
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
index 39424e1..42e92fd 100755
--- a/scripts/imagetransfer.py
+++ b/scripts/imagetransfer.py
@@ -27,7 +27,7 @@
"""
#
# (C) Andre Engels, 2004
-# (C) Pywikibot team, 2004-2017
+# (C) Pywikibot team, 2004-2018
#
# Distributed under the terms of the MIT license.
#
@@ -119,7 +119,7 @@
def __init__(self, generator, targetSite=None, interwiki=False,
keep_name=False, ignore_warning=False):
- """Constructor."""
+ """Initializer."""
self.generator = generator
self.interwiki = interwiki
self.targetSite = targetSite
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index f9a7ea1..36d08fa 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -602,7 +602,7 @@
SPdeleteStore = staticmethod(SPdeleteStore)
def __init__(self, page):
- """Constructor."""
+ """Initializer."""
for attr in StoredPage.SPcopy:
setattr(self, attr, getattr(page, attr))
@@ -645,7 +645,7 @@
"""
def __init__(self):
- """Constructor.
+ """Initializer.
While using dict values would be faster for the remove() operation,
keeping list values is important, because the order in which the pages
@@ -780,7 +780,7 @@
def __init__(self, originPage=None, hints=None, conf=None):
"""
- Constructor.
+ Initializer.
Takes as arguments the Page on the home wiki
plus optionally a list of hints for translation
@@ -2006,7 +2006,7 @@
"""
def __init__(self, conf=None):
- """Constructor."""
+ """Initializer."""
self.subjects = []
# We count how many pages still need to be loaded per site.
# This allows us to find out from which site to retrieve pages next
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index 9b3449d..229e5cc 100644
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -23,7 +23,7 @@
-summary: Use your own edit summary for cleaning the page.
"""
-# (C) Pywikibot team, 2015-2017
+# (C) Pywikibot team, 2015-2018
#
# Distributed under the terms of the MIT license.
#
@@ -52,7 +52,7 @@
"""The bot for interwiki."""
def __init__(self, **kwargs):
- """Construct the bot."""
+ """Initialize the bot."""
self.availableOptions.update({
'clean': False,
'create': False,
diff --git a/scripts/isbn.py b/scripts/isbn.py
index 94cd33d..ef19b41 100755
--- a/scripts/isbn.py
+++ b/scripts/isbn.py
@@ -1227,7 +1227,7 @@
"""ISBN 13."""
def __init__(self, code, checksumMissing=False):
- """Constructor."""
+ """Initializer."""
self.code = code
if checksumMissing:
self.code += str(self.calculateChecksum())
@@ -1276,7 +1276,7 @@
"""ISBN 10."""
def __init__(self, code):
- """Constructor."""
+ """Initializer."""
self.code = code
self.checkValidity()
@@ -1484,7 +1484,7 @@
"""ISBN bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'to13': False,
'format': False,
@@ -1544,7 +1544,7 @@
use_from_page = None
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'to13': False,
'format': False,
diff --git a/scripts/listpages.py b/scripts/listpages.py
index 4214409..511b4e4 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -88,7 +88,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
@@ -123,7 +123,7 @@
def __init__(self, page, outputlang=None, default='******'):
"""
- Constructor.
+ Initializer.
@param page: the page to be formatted.
@type page: Page object.
diff --git a/scripts/lonelypages.py b/scripts/lonelypages.py
index 8f4d2d1..a8e0131 100755
--- a/scripts/lonelypages.py
+++ b/scripts/lonelypages.py
@@ -59,7 +59,7 @@
"""The orphan template configuration."""
def __init__(self, site, name, parameters, aliases=None, subst=False):
- """Constructor."""
+ """Initializer."""
self._name = name
if not aliases:
aliases = []
@@ -105,7 +105,7 @@
"""Orphan page tagging bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'enablePage': None, # Check if someone set an enablePage or not
'disambigPage': None, # If no disambigPage given, not use it.
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index efde576..27752da 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -59,7 +59,7 @@
uniquedesc(entry)
"""
#
-# (C) Pywikibot team, 2014-2017
+# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
#
@@ -98,7 +98,7 @@
"""A Request cache entry."""
def __init__(self, directory, filename):
- """Constructor."""
+ """Initializer."""
self.directory = directory
self.filename = filename
diff --git a/scripts/maintenance/compat2core.py b/scripts/maintenance/compat2core.py
index 35066a5..e0964f5 100755
--- a/scripts/maintenance/compat2core.py
+++ b/scripts/maintenance/compat2core.py
@@ -26,7 +26,7 @@
python pwb.py compat2core <scriptname> -warnonly
"""
#
-# (C) xqt, 2014-2017
+# (C) xqt, 2014-2018
# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
@@ -131,7 +131,7 @@
"""Script conversion bot."""
def __init__(self, filename=None, warnonly=False):
- """Constructor."""
+ """Initializer."""
self.source = filename
self.warnonly = warnonly
diff --git a/scripts/maintenance/make_i18n_dict.py
b/scripts/maintenance/make_i18n_dict.py
index da0f1c2..f735109 100755
--- a/scripts/maintenance/make_i18n_dict.py
+++ b/scripts/maintenance/make_i18n_dict.py
@@ -29,8 +29,8 @@
>> bot.to_json()
"""
#
-# (C) xqt, 2013-2017
-# (C) Pywikibot team, 2013-2017
+# (C) xqt, 2013-2018
+# (C) Pywikibot team, 2013-2018
#
# Distributed under the terms of the MIT license.
#
@@ -48,7 +48,7 @@
"""I18n bot."""
def __init__(self, script, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
modules = script.split('.')
self.scriptname = modules[0]
self.script = __import__('scripts.' + self.scriptname)
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index d832c40..4cff5ab 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -72,7 +72,7 @@
}
def __init__(self, always, firstPageTitle, main_only):
- """Constructor."""
+ """Initializer."""
super(MisspellingRobot, self).__init__(
always, [], True, False, None, False, main_only)
self.generator = self.createPageGenerator(firstPageTitle)
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 5c6b3f8..1bbeb60 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -34,7 +34,7 @@
#
# (C) Leonardo Gregianin, 2006
# (C) Andreas J. Schwab, 2007
-# (C) Pywikibot team, 2006-2017
+# (C) Pywikibot team, 2006-2018
#
# Distributed under the terms of the MIT license.
#
@@ -62,7 +62,7 @@
"""Page move bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'prefix': None,
'noredirect': False,
diff --git a/scripts/ndashredir.py b/scripts/ndashredir.py
index 3937188..a9b3245 100644
--- a/scripts/ndashredir.py
+++ b/scripts/ndashredir.py
@@ -27,7 +27,7 @@
"""
#
# (C) Bináris, 2012
-# (C) Pywikibot team, 2012-2017
+# (C) Pywikibot team, 2012-2018
#
# Distributed under the terms of the MIT license.
#
@@ -58,7 +58,7 @@
def __init__(self, generator, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: the page generator that determines which pages
to work on
@@ -70,7 +70,7 @@
'reversed': False, # switch bot behavior
})
- # call constructor of the super class
+ # call initializer of the super class
super(DashRedirectBot, self).__init__(site=True, **kwargs)
# assign the generator to the bot
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index 35e7bf3..838c244 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -490,7 +490,7 @@
"""References section bot."""
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'verbose': True,
})
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index 7c015d7..d770cb3 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -180,7 +180,7 @@
"""Bot to delete migrated files."""
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'replace': False,
'replacealways': False,
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index a13d9de..6df0993 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -83,7 +83,7 @@
"""No title found."""
def __init__(self, offset):
- """Constructor."""
+ """Initializer."""
self.offset = offset
@@ -97,7 +97,7 @@
"""
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'always': True,
'force': False,
@@ -205,7 +205,7 @@
}
def __init__(self, filename, **kwargs):
- """Constructor.
+ """Initializer.
Check if self.file name exists. If not, ask for a new filename.
User can quit.
diff --git a/scripts/patrol.py b/scripts/patrol.py
index 1f3b897..0f79da6 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -85,7 +85,7 @@
def __init__(self, site=True, **kwargs):
"""
- Constructor.
+ Initializer.
@kwarg feed: The changes feed to work on (Newpages or Recentchanges)
@kwarg ask: If True, confirm each patrol action
@@ -395,7 +395,7 @@
"""Matches of page site title and linked pages
title."""
def __init__(self, page_title):
- """Constructor.
+ """Initializer.
@param page_title: The page title for this rule
@type page_title: pywikibot.Page
diff --git a/scripts/piper.py b/scripts/piper.py
index fc5aba9..50296b7 100755
--- a/scripts/piper.py
+++ b/scripts/piper.py
@@ -29,7 +29,7 @@
the order which they are given
"""
#
-# (C) Pywikibot team, 2008-2017
+# (C) Pywikibot team, 2008-2018
#
# Distributed under the terms of the MIT license.
#
@@ -62,7 +62,7 @@
def __init__(self, generator, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: The page generator that determines on which pages
to work on.
diff --git a/scripts/redirect.py b/scripts/redirect.py
index b1d0bea..f95bd6d1 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -118,7 +118,7 @@
}
def __init__(self, action, **kwargs):
- """Constructor."""
+ """Initializer."""
super(RedirectGenerator, self).__init__(**kwargs)
self.site = pywikibot.Site()
self.use_api = self.getOption('fullscan')
@@ -405,7 +405,7 @@
"""Redirect bot."""
def __init__(self, action, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'total': float('inf'),
'delete': False,
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 3e73007..7591f01 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -197,7 +197,7 @@
"""Container to handle a single bare reference."""
def __init__(self, link, name, site=None):
- """Constructor."""
+ """Initializer."""
self.refname = name
self.link = link
self.site = site or pywikibot.Site()
@@ -281,11 +281,10 @@
"""
def __init__(self, site=None):
- """Constructor."""
+ """Initializer."""
if not site:
site = pywikibot.Site()
- """Constructor."""
# Match references
self.REFS = re.compile(
r'(?i)<ref(?P<params>[^>/]*)>(?P<content>.*?)</ref>')
diff --git a/scripts/replace.py b/scripts/replace.py
index ae6cf05..6d5ba9d 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -408,12 +408,12 @@
compiled regular expression) and replacement text (as a string).
@type replacements: list of 2-tuples
@param exceptions: A dictionary which defines when to ignore an
- occurrence. See docu of the ReplaceRobot constructor below.
+ occurrence. See docu of the ReplaceRobot initializer below.
@type exceptions: dict
"""
def __init__(self, xmlFilename, xmlStart, replacements, exceptions, site):
- """Constructor."""
+ """Initializer."""
self.xmlFilename = xmlFilename
self.replacements = replacements
self.exceptions = exceptions
@@ -547,7 +547,7 @@
def __init__(self, generator, replacements, exceptions={},
allowoverlap=False, recursive=False, addedCat=None,
sleep=None, summary='', **kwargs):
- """Constructor."""
+ """Initializer."""
super(ReplaceRobot, self).__init__(generator=generator,
**kwargs)
diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
index 9037131..7545031 100755
--- a/scripts/replicate_wiki.py
+++ b/scripts/replicate_wiki.py
@@ -74,7 +74,7 @@
"""Work is done in here."""
def __init__(self, options):
- """Constructor."""
+ """Initializer."""
self.options = options
if options.original_wiki:
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index db32d74..7e51704 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -58,7 +58,7 @@
"""
def __init__(self, site, user=None, comment=None, rollback=False):
- """Constructor."""
+ """Initializer."""
self.site = site
self.comment = comment
self.user = user
diff --git a/scripts/script_wui.py b/scripts/script_wui.py
index 5e61c61..3b5ec56 100755
--- a/scripts/script_wui.py
+++ b/scripts/script_wui.py
@@ -18,7 +18,7 @@
"""
#
# (C) Dr. Trigon, 2012-2014
-# (C) Pywikibot team, 2014-2017
+# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
#
@@ -123,7 +123,7 @@
"""WikiUserInterface bot."""
def __init__(self, *arg):
- """Constructor."""
+ """Initializer."""
pywikibot.output(color_format(
'{lightgreen}* Initialization of bot{default}'))
diff --git a/scripts/selflink.py b/scripts/selflink.py
index afd2adb..a5b2ad6 100755
--- a/scripts/selflink.py
+++ b/scripts/selflink.py
@@ -11,7 +11,7 @@
ATTENTION: Use this with care!
"""
#
-# (C) Pywikibot team, 2006-2017
+# (C) Pywikibot team, 2006-2018
#
# Distributed under the terms of the MIT license.
#
@@ -49,7 +49,7 @@
summary_key = 'selflink-remove'
def __init__(self, generator, **kwargs):
- """Constructor."""
+ """Initializer."""
super(SelflinkBot, self).__init__(**kwargs)
self.generator = generator
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 50e5001..7d60da6 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -382,7 +382,7 @@
"""Referring Page generator, with an ignore
manager."""
def __init__(self, disambPage, primary=False, minimum=0, main_only=False):
- """Constructor.
+ """Initializer.
@type disambPage: pywikibot.Page
@type primary: bool
@@ -442,7 +442,7 @@
"""
def __init__(self, disambPage, enabled=False):
- """Constructor.
+ """Initializer.
@type disambPage: pywikibot.Page
@type enabled: bool
@@ -524,7 +524,7 @@
"""Edit the text."""
def __init__(self, option, shortcut, text, start, title):
- """Constructor.
+ """Initializer.
@type option: str
@type shortcut: str
@@ -561,7 +561,7 @@
"""Show the page's contents in an editor."""
def __init__(self, option, shortcut, start, page):
- """Constructor."""
+ """Initializer."""
super(ShowPageOption, self).__init__(option, shortcut, False)
self._start = start
if page.isRedirectPage():
@@ -581,7 +581,7 @@
"""An option allowing multiple aliases which also select
it."""
def __init__(self, option, shortcuts, stop=True):
- """Constructor."""
+ """Initializer."""
super(AliasOption, self).__init__(option, shortcuts[0], stop)
self._aliases = frozenset(s.lower() for s in shortcuts[1:])
@@ -619,7 +619,7 @@
def __init__(self, always, alternatives, getAlternatives, dnSkip,
generator, primary, main_only, minimum=0):
- """Constructor."""
+ """Initializer."""
super(DisambiguationRobot, self).__init__()
self.always = always
self.alternatives = alternatives
diff --git a/scripts/spamremove.py b/scripts/spamremove.py
index 888ecf5..2502895 100755
--- a/scripts/spamremove.py
+++ b/scripts/spamremove.py
@@ -27,7 +27,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2007-2017
+# (C) Pywikibot team, 2007-2018
#
# Distributed under the terms of the MIT license.
#
@@ -65,7 +65,7 @@
summary_key = 'spamremove-remove'
def __init__(self, generator, spam_external_url, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'summary': None,
})
diff --git a/scripts/states_redirect.py b/scripts/states_redirect.py
index 77a73b1..c04d7a8 100755
--- a/scripts/states_redirect.py
+++ b/scripts/states_redirect.py
@@ -15,7 +15,7 @@
"""
#
# (C) Andre Engels, 2004
-# (C) Pywikibot team, 2004-2017
+# (C) Pywikibot team, 2004-2018
#
# Distributed under the terms of the MIT license.
#
@@ -42,7 +42,7 @@
"""Bot class used for implementation of re-direction
norms."""
def __init__(self, start, force):
- """Constructor.
+ """Initializer.
Parameters:
@param start:xxx Specify the place in the alphabet to start
diff --git a/scripts/surnames_redirects.py b/scripts/surnames_redirects.py
index 5fadd38..949e3a6 100755
--- a/scripts/surnames_redirects.py
+++ b/scripts/surnames_redirects.py
@@ -36,7 +36,7 @@
"""Surnames Bot."""
def __init__(self, generator, **kwargs):
- """Constructor.
+ """Initializer.
Parameters:
@param generator: The page generator that determines on
diff --git a/scripts/table2wiki.py b/scripts/table2wiki.py
index 5eb40ab..fb33807 100644
--- a/scripts/table2wiki.py
+++ b/scripts/table2wiki.py
@@ -38,7 +38,7 @@
"""
#
# (C) 2003 Thomas R. Koll, <tomk32(a)tomk32.de>
-# (C) Pywikibot team, 2003-2017
+# (C) Pywikibot team, 2003-2018
#
# Distributed under the terms of the MIT license.
#
@@ -70,7 +70,7 @@
"""Generator to yield all pages that seem to contain an HTML
table."""
def __init__(self, xmlfilename):
- """Constructor."""
+ """Initializer."""
self.xmldump = xmlreader.XmlDump(xmlfilename)
def __iter__(self):
@@ -90,7 +90,7 @@
"""
def __init__(self, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'quiet': False, # quiet mode, less output
'skipwarning': False # on warning skip that page
diff --git a/scripts/template.py b/scripts/template.py
index f3731cd..e112018 100755
--- a/scripts/template.py
+++ b/scripts/template.py
@@ -141,7 +141,7 @@
def __init__(self, templates, xmlfilename):
"""
- Constructor.
+ Initializer.
@param templateNames: A list of Page objects representing the searched
templates
@@ -179,7 +179,7 @@
def __init__(self, generator, templates, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: the pages to work on
@type generator: iterable
diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index ff70d51..87ea3eb 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -14,7 +14,7 @@
#
# (C) Leonardo Gregianin, 2007
# (C) Filnik, 2008
-# (c) xqt, 2011-2016
+# (c) xqt, 2011-2018
# (C) Pywikibot team, 2015-2018
#
# Distributed under the terms of the MIT license.
@@ -43,7 +43,7 @@
"""Unused files bot."""
def __init__(self, site, **kwargs):
- """Constructor."""
+ """Initializer."""
self.availableOptions.update({
'nouserwarning': False # do not warn uploader
})
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index e0c4ee8..e26f981 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -312,7 +312,7 @@
def __init__(self, url, redirectChain=[], serverEncoding=None,
HTTPignore=[]):
"""
- Constructor.
+ Initializer.
redirectChain is a list of redirects which were resolved by
resolveRedirect(). This is needed to detect redirect loops.
@@ -572,7 +572,7 @@
"""
def __init__(self, page, url, history, HTTPignore, day):
- """Constructor."""
+ """Initializer."""
threading.Thread.__init__(self)
self.page = page
self.url = url
@@ -650,7 +650,7 @@
"""
def __init__(self, reportThread, site=None):
- """Constructor."""
+ """Initializer."""
self.reportThread = reportThread
if not site:
self.site = pywikibot.Site()
@@ -765,7 +765,7 @@
"""
def __init__(self):
- """Constructor."""
+ """Initializer."""
threading.Thread.__init__(self)
self.semaphore = threading.Semaphore()
self.queue = []
@@ -865,7 +865,7 @@
"""
def __init__(self, generator, HTTPignore=None, day=7, site=True):
- """Constructor."""
+ """Initializer."""
super(WeblinkCheckerRobot, self).__init__(
generator=generator, site=site)
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 782f372..d160193 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -436,7 +436,7 @@
"""Bot to add welcome messages on User pages."""
def __init__(self):
- """Constructor."""
+ """Initializer."""
self.site = pywikibot.Site()
self.check_managed_sites()
self.bname = {}
diff --git a/scripts/wikisourcetext.py b/scripts/wikisourcetext.py
index d9bd119..bbbbd5a 100644
--- a/scripts/wikisourcetext.py
+++ b/scripts/wikisourcetext.py
@@ -46,7 +46,7 @@
-always don't bother asking to confirm any of the changes.
"""
#
-# (C) Pywikibot team, 2016-2017
+# (C) Pywikibot team, 2016-2018
#
# Distributed under the terms of the MIT license.
#
@@ -75,7 +75,7 @@
def __init__(self, generator, **kwargs):
"""
- Constructor.
+ Initializer.
@param generator: page generator
@type generator: generator
diff --git a/tests/__init__.py b/tests/__init__.py
index 90ea92d..650ccac 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -279,7 +279,7 @@
"""Add caching to every Request except logins."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(TestRequest, self).__init__(0, *args, **kwargs)
@classmethod
diff --git a/tests/aspects.py b/tests/aspects.py
index 5af26b2..3d420d5 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -419,7 +419,7 @@
"""Site interface to prevent sites being loaded."""
def __init__(self, code, fam=None, user=None, sysop=None):
- """Constructor."""
+ """Initializer."""
raise pywikibot.SiteDefinitionError(
'Loading site %s:%s during dry test not permitted'
% (fam, code))
@@ -1086,7 +1086,7 @@
code in usernames['*'] or '*' in usernames['*'])
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(TestCase, self).__init__(*args, **kwargs)
if not hasattr(self, 'sites'):
@@ -1396,7 +1396,7 @@
return cls.repo
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(WikibaseTestCase, self).__init__(*args, **kwargs)
if not hasattr(self, 'sites'):
@@ -1575,7 +1575,7 @@
source_adjustment_skips.append(unittest.case._AssertRaisesBaseContext)
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(DeprecationTestCase, self).__init__(*args, **kwargs)
self.warning_log = []
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index e8fa034..3cbb7aa 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for deprecation tools."""
#
-# (C) Pywikibot team, 2014-2016
+# (C) Pywikibot team, 2014-2018
#
# Distributed under the terms of the MIT license.
#
@@ -258,7 +258,7 @@
"""Deprecated class."""
def __init__(self, foo=None):
- """Constructor."""
+ """Initializer."""
self.foo = foo
diff --git a/tests/utils.py b/tests/utils.py
index 572c3a0..0fa75ee 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -158,7 +158,7 @@
def __init__(self, skip_list):
"""
- Constructor.
+ Initializer.
@param skip_list: List of objects to be skipped. The source of any
warning that matches the skip_list won't be adjusted.
@@ -295,7 +295,7 @@
"""Dummy class to use instead of
L{pywikibot.data.api.ParamInfo}."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
super(DryParamInfo, self).__init__(*args, **kwargs)
self.modules = set()
self.action_modules = set()
@@ -324,7 +324,7 @@
"""Dummy class to use instead of
L{pywikibot.site.Siteinfo}."""
def __init__(self, cache):
- """Constructor."""
+ """Initializer."""
self._cache = {key: (item, False) for key, item in cache.items()}
def __getitem__(self, key):
@@ -372,7 +372,7 @@
"""Dummy class to use instead of
L{pywikibot.data.api.Request}."""
def __init__(self, *args, **kwargs):
- """Constructor."""
+ """Initializer."""
_original_Request.__init__(self, *args, **kwargs)
@classmethod
@@ -401,7 +401,7 @@
_loginstatus = pywikibot.site.LoginStatus.NOT_ATTEMPTED
def __init__(self, code, fam, user, sysop):
- """Constructor."""
+ """Initializer."""
super(DrySite, self).__init__(code, fam, user, sysop)
self._userinfo = pywikibot.tools.EMPTY_DEFAULT
self._paraminfo = DryParamInfo()
@@ -517,7 +517,7 @@
"""A class simulating the http module."""
def __init__(self, wrapper):
- """Constructor with the given PatchedHttp
instance."""
+ """Initializer with the given PatchedHttp
instance."""
self.__wrapper = wrapper
def request(self, *args, **kwargs):
@@ -579,7 +579,7 @@
def __init__(self, module, data=None):
"""
- Constructor.
+ Initializer.
@param module: The given module to patch. It must have the http module
imported as http.
--
To view, visit
https://gerrit.wikimedia.org/r/434190
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I40f1d82c8396dec6c8ac021817f5c79c0b3c7291
Gerrit-Change-Number: 434190
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: jenkins-bot <>