jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/382308 )
Change subject: globalusage: yield all the API results
......................................................................
globalusage: yield all the API results
Avoid to use self._update_page() in site.globalusage.
With page continuation, all batches will be consumed by the ieration
inside self._update_page().
And only the ast portion of results would be yielded.
Do only one iteration over query instead.
Bug: T177362
Change-Id: I8ad5e203cbabba26bd3c3971fd27982935350509
---
M pywikibot/site.py
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 1f8f534..5dff0df 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3028,9 +3028,13 @@
total=total, # will set gulimit=total in api,
**args)
- self._update_page(page, query)
-
for pageitem in query:
+ if not self.sametitle(pageitem['title'],
+ page.title(withSection=False)):
+ raise InconsistentTitleReceived(page, pageitem['title'])
+
+ api.update_page(page, pageitem, query.props)
+
assert 'globalusage' in pageitem, \
"API globalusage response lacks 'globalusage' key"
for entry in pageitem['globalusage']:
--
To view, visit
https://gerrit.wikimedia.org/r/382308
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ad5e203cbabba26bd3c3971fd27982935350509
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>