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 <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378877 )
Change subject: Fix behavior when treat_missing_item is None
......................................................................
Fix behavior when treat_missing_item is None
When is_item is False, we should obviously try to
load the page's item if it has one.
Change-Id: I510830ff85d747dd370dc9f69c62d3e0dfdfd5e3
---
M pywikibot/bot.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 3444389..03e22e8 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -2130,7 +2130,10 @@
item = pywikibot.ItemPage(data_site, page.title())
page = None
else:
- item = None
+ try:
+ item = pywikibot.ItemPage.fromPage(page)
+ except pywikibot.NoPage:
+ item = None
if self.use_from_page is False:
pywikibot.error('{0} is not in the item namespace but '
'must be an item.'.format(page))
--
To view, visit https://gerrit.wikimedia.org/r/378877
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I510830ff85d747dd370dc9f69c62d3e0dfdfd5e3
Gerrit-PatchSet: 1
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: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>