jenkins-bot has submitted this change and it was merged.
Change subject: Consistently use "MediaWiki" in CamelCase
......................................................................
Consistently use "MediaWiki" in CamelCase
- replaced "mediawiki", only in docstring and comments
Change-Id: I979f4c040af8979109f9246eaab8b4c2f7e368b6
---
M pywikibot/page.py
M pywikibot/site.py
M scripts/data_ingestion.py
M scripts/flickrripper.py
M scripts/reflinks.py
5 files changed, 14 insertions(+), 14 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 33d3c6d..cd53b78 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -589,7 +589,7 @@
By default, loads a list of template names from the Family file;
if the value in the Family file is None no entry was made, looks for
the list on [[MediaWiki:Disambiguationspage]]. If this page does not
- exist, take the mediawiki message.
+ exist, take the MediaWiki message.
If get_Index is True then also load the templates for index articles
which are given on en-wiki
@@ -2164,7 +2164,7 @@
@deprecated('User.registration()')
def registrationTime(self, force=False):
""" Return registration date for this user, as a long in
- Mediawiki's internal timestamp format, or 0 if the date is unknown.
+ MediaWiki's internal timestamp format, or 0 if the date is unknown.
@param force: if True, forces reloading the data from API
@type force: bool
@@ -2206,7 +2206,7 @@
return 'blockedby' in self.getprops(force)
def isEmailable(self, force=False):
- """ Return True if emails can be send to this user through mediawiki,
+ """ Return True if emails can be send to this user through MediaWiki,
False otherwise.
@param force: if True, forces reloading the data from API
@@ -2262,7 +2262,7 @@
self.site, defaultNamespace=3))
def sendMail(self, subject, text, ccme=False):
- """ Send an email to this user via mediawiki's email interface.
+ """ Send an email to this user via MediaWiki's email interface.
Return True on success, False otherwise.
This method can raise an UserActionRefuse exception in case this user
doesn't allow sending email to him or the currently logged in bot
@@ -3123,7 +3123,7 @@
class Link(ComparableMixin):
- """A Mediawiki link (local or interwiki)
+ """A MediaWiki link (local or interwiki)
Has the following attributes:
@@ -3187,7 +3187,7 @@
# Normalize unicode string to a NFC (composed) format to allow
# proper string comparisons. According to
# http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_6/phase3/includes/n…
- # the mediawiki code normalizes everything to NFC, not NFKC
+ # the MediaWiki code normalizes everything to NFC, not NFKC
# (which might result in information loss).
t = unicodedata.normalize('NFC', t)
diff --git a/pywikibot/site.py b/pywikibot/site.py
index ea1cbad..971edc5 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -572,7 +572,7 @@
def need_version(version):
- """ Decorator to require a certain mediawiki version number.
+ """ Decorator to require a certain MediaWiki version number.
@param number: the mw version number required
@return: a decorator to make sure the requirement is statisfied when
@@ -583,7 +583,7 @@
if LV(self.version()) < LV(version):
raise NotImplementedError(
u'Method or function "%s"\n'
- u"isn't implemented in mediawiki version < %s"
+ u"isn't implemented in MediaWiki version < %s"
% (fn.__name__, version))
return fn(self, *args, **kwargs)
callee.__name__ = fn.__name__
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index 19d331b..4f11224 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -58,7 +58,7 @@
def findDuplicateImages(self,
site=pywikibot.Site(u'commons', u'commons')):
"""
- Takes the photo, calculates the SHA1 hash and asks the mediawiki api
+ Takes the photo, calculates the SHA1 hash and asks the MediaWiki api
for a list of duplicates.
TODO: Add exception handling, fix site thing
@@ -192,7 +192,7 @@
def findDuplicateImages(self, photo=None, site=pywikibot.Site(u'commons', u'commons')):
"""
- Takes the photo, calculates the SHA1 hash and asks the mediawiki api for a list of duplicates.
+ Takes the photo, calculates the SHA1 hash and asks the MediaWiki api for a list of duplicates.
TODO: Add exception handling, fix site thing
"""
diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index a72d150..8cfdf7b 100644
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -119,7 +119,7 @@
def findDuplicateImages(photo=None,
site=pywikibot.Site(u'commons', u'commons')):
- """ Take the photo, calculate the SHA1 hash and ask the mediawiki api
+ """ Take the photo, calculate the SHA1 hash and ask the MediaWiki api
for a list of duplicates.
TODO: Add exception handling, fix site thing
@@ -195,7 +195,7 @@
def cleanUpTitle(title):
- """ Clean up the title of a potential mediawiki page. Otherwise the title of
+ """ Clean up the title of a potential MediaWiki page. Otherwise the title of
the page might not be allowed by the software.
"""
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index e9fd399..fdb6ce2 100644
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -63,10 +63,10 @@
'¶ms;': pagegenerators.parameterHelp
}
-localized_msg = ('fr', 'it', 'pl') # localized message at mediawiki
+localized_msg = ('fr', 'it', 'pl') # localized message at MediaWiki
# localized message at specific wikipedia site
-# should be moved to mediawiki pywikibot manual
+# should be moved to MediaWiki pywikibot manual
stopPage = {
--
To view, visit https://gerrit.wikimedia.org/r/138288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I979f4c040af8979109f9246eaab8b4c2f7e368b6
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Audiodude <audiodude(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Update usage help string
......................................................................
Update usage help string
The usage help message looked wrong to me.
Change-Id: I0773dc7a76686058d2a20efd1f074496cd50fc43
---
M scripts/illustrate_wikidata.py
1 file changed, 2 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
index 5a845ff..a906943 100644
--- a/scripts/illustrate_wikidata.py
+++ b/scripts/illustrate_wikidata.py
@@ -2,13 +2,12 @@
# -*- coding: utf-8 -*-
"""
Bot to add images to Wikidata items. The image is extracted from the page_props.
-For this to be available the PageImages extension (https://www.mediawiki.org/wiki/Extension:PageImages) needs to be installed
+For this to be available the PageImages extension
+(https://www.mediawiki.org/wiki/Extension:PageImages) needs to be installed
Usage:
python illustrate_wikidata.py <some generator>
-
-python harvest_template.py -lang:en -catr:Category:Railway_stations_in_New_York
¶ms;
"""
--
To view, visit https://gerrit.wikimedia.org/r/138230
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0773dc7a76686058d2a20efd1f074496cd50fc43
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: improvements to APISite#rollbackpage()
......................................................................
improvements to APISite#rollbackpage()
- removed unused variable 'summary'
- used **kwargs to support custom arguments
Change-Id: Ic1a56f1742df6c55bb4c498f2670585d65c8ed41
---
M pywikibot/site.py
1 file changed, 5 insertions(+), 7 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 2d2d243..cc27276 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2989,15 +2989,16 @@
"alreadyrolled": "Page [[%(title)s]] already rolled back; action aborted.",
} # other errors shouldn't arise because we check for those errors
- def rollbackpage(self, page, summary=u''):
+ def rollbackpage(self, page, **kwargs):
"""Roll back page to version before last user's edits.
+
+ The keyword arguments are those supported by the rollback API.
As a precaution against errors, this method will fail unless
the page history contains at least two revisions, and at least
one that is not by the same user who made the last edit.
@param page: the Page to be rolled back (must exist)
- @param summary: edit summary (defaults to a standardized message)
"""
if len(page._revisions) < 2:
@@ -3015,16 +3016,13 @@
raise pywikibot.Error(
u"Rollback of %s aborted; only one user in revision history."
% page.title(asLink=True))
- summary = summary or (
- u"Reverted edits by [[Special:Contributions/%(last_user)s|%(last_user)s]] "
- u"([[User talk:%(last_user)s|Talk]]) to last version by %(prev_user)s"
- % locals())
token = self.token(page, "rollback")
self.lock_page(page)
req = api.Request(site=self, action="rollback",
title=page.title(withSection=False),
user=last_user,
- token=token)
+ token=token,
+ **kwargs)
try:
result = req.submit()
except api.APIError as err:
--
To view, visit https://gerrit.wikimedia.org/r/135421
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1a56f1742df6c55bb4c498f2670585d65c8ed41
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>