jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/336433 )
Change subject: [IMPR] Return self when data_repository() is called on DataSite
......................................................................
[IMPR] Return self when data_repository() is called on DataSite
This motivated by the fact that a data repository doesn't need another
one as it can provide its data to itself. It also saves some time on
initialization because this information is retrieved from the API.
Change-Id: Ia245a7bb29f1260f3f690b07c3b1222e4addf755
---
M pywikibot/site.py
1 file changed, 12 insertions(+), 0 deletions(-)
Approvals:
Zhuyifei1999: Looks good to me, but someone else must approve
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 2491a54..e5f537b 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -7160,6 +7160,18 @@
# not implemented yet
raise NotImplementedError
+ def data_repository(self):
+ """
+ Override parent method.
+
+ This avoids pointless API queries since the data repository
+ is this site by definition.
+
+ @return: this Site object
+ @rtype: DataSite
+ """
+ return self
+
def loadcontent(self, identification, *props):
"""
Fetch the current content of a Wikibase item.
--
To view, visit https://gerrit.wikimedia.org/r/336433
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia245a7bb29f1260f3f690b07c3b1222e4addf755
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3841
Status: Errored
Duration: 47 minutes and 7 seconds
Commit: 8a8d7c2 (master)
Author: zhuyifei1999
Message: checkimages.py: Prevent TypeError when self.num_notify is None
When the max notification is not set, self.num_notify will be None
instead of defaultdict, and attempting to reduce the value of an
element will result in:
TypeError: 'NoneType' object has no attribute '__getitem__'
We check if self.num_notify is not None earlier in order to prevent
this exception.
The logic of checking if the counter has ran out has also been changed
from `not value` to `value == 0` for clarity.
Follow up for I9e25b35d42af3c73c581c6d05a6a4a8dc8ef62c6
Bug: T157728
Change-Id: I7d5966c52dff4b342942abe030295f3e3c1f422f
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/3fe50790a031...8a8d7c2c…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/200929360
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications