Ciencia_Al_Poder created this task. Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder. Ciencia_Al_Poder added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION I've noticed that -step isn't taken into account when using -file as a generator.
For example, I've generated a file with a list of pages to work on. And I want Pywikibot to run them in that specific order, because that will improve the review process later.
Pywikibot by default tries to retrieve information of 50 pages by default, but the api returns them in alphabetic (pagename) order rather than the order in which we've requested it. Hence, I found that -step will solve the issue by querying pages one by one, following the same order.
The problem is that pywikibot ignores -step for -file, so it keeps returning 50 pages at a time.
TASK DETAIL https://phabricator.wikimedia.org/T94746
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Ciencia_Al_Poder Cc: pywikipedia-bugs, Ciencia_Al_Poder, Aklapper, jayvdb
Ciencia_Al_Poder added a comment.
I've found that the fix is, in each script that use generators, change
gen = pagegenerators.PreloadingGenerator(gen)
with
gen = pagegenerators.PreloadingGenerator(gen, genFactory.step)
And that works for me.
That's because PreloadingGenerator has a step parameter that defaults to 50, and since none of the scripts specifies it, then it takes it as the current step value
TASK DETAIL https://phabricator.wikimedia.org/T94746
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Ciencia_Al_Poder Cc: pywikipedia-bugs, Ciencia_Al_Poder, Aklapper, jayvdb
XZise added a subscriber: XZise. XZise added a comment.
I've actually written a patch which will return the pages in the requested order when using `PreloadingGenerator`: https://gerrit.wikimedia.org/r/#/c/199631/ You might give it a spin, though this bug here might still be relevant.
TASK DETAIL https://phabricator.wikimedia.org/T94746
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, Ciencia_Al_Poder, Aklapper, jayvdb, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org