Repository navigation
feat: pull a set of pages by category, prefix, or everything tracked - #17
Merged
Merged
Conversation
pull now takes --category and --prefix (both repeatable, combinable with titles); with nothing named it pulls every tracked page again. Listings come from a generator with prop=info, so each page's language is known without fetching its text. Category and prefix results keep only pages in the wiki's own language unless --all-languages is given: on Appropedia, 15 of the 21 pages in Category:Simple living are machine translations. The --max cap (default 500) is checked after that filter and before any text is fetched; Category:Water is 231 pages after it. Titles named explicitly are always pulled. Page text is fetched 50 titles per POST request, with MediaWiki's title normalization mapped back to the requested title. Prefixes resolve their namespace from the wiki's own namespace names and aliases. Subcategories are not followed. Writing, dirty-file and collision handling stay in core.Pull.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
pullcan take a whole set of pages:--categoryand--prefixrepeat and combine with explicit titles.are machine translations by a bot (
Page/es,Page/ar, …, each with its ownpage language). Listings use a generator with
prop=info, so each page'slanguage is known without fetching its text; only the wiki's own language is
kept unless
--all-languagesis given. Titles named explicitly are alwayspulled.
--max(default 500) refuses an oversized selection after the languagefilter and before any page text is fetched.
mw.FetchPages), withMediaWiki's title normalization mapped back to the requested title.
--prefixresolves the namespace from the wiki's own names and aliases, soNotes: draftin the main namespace isn't mistaken for a namespace.core.Pull.core.PullSetonly decides which pages and fetches them.Verification
PullSet(translations skipped,--all-languages, explicit titlesalways pulled, the limit counted after filtering with nothing fetched when
exceeded,
Water_Pump/Water Pumprequested once, bare pull refreshestracked pages, nothing-to-pull, a selector matching nothing); client
(siteinfo parsed and cached, category continuation, prefix namespace
resolution including aliases and a colon that isn't a namespace, 51 titles in
2 POSTs with normalization and a missing page).
titles, underscore/space matching, refresh, continuation, normalization,
namespace resolution, siteinfo cache) fails its target test.
--prefix "User:CameronBrooks11/"pulled the 3 user subpages intoUser/CameronBrooks11/;--category "Simple living"pulled 6 pages and skipped 15 translations(the category's 21 pages);
--category Water --max 100was refused: "the selection has 231 pages";pullre-pulled all 9 tracked pages, andstatuslists 9.