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.
pywikibot-commits@lists.wikimedia.org