forked from mediawiki-client-tools/mediawiki-dump-generator
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: increasemental xmldump (--xmlrevisions) PoC
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import argparse | ||
|
||
from wikiteam3.dumpgenerator.dump.xmldump.xml_truncate import parse_last_page_chunk, truncateXMLDump | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Get the next arvcontinue value") | ||
parser.add_argument("xml", help="XML file") | ||
args = parser.parse_args() | ||
return args | ||
|
||
def main(): | ||
args = parse_args() | ||
xmlfile: str = args.xml | ||
lastPageChunk = truncateXMLDump(xmlfile, dryrun=True) | ||
lastPage = parse_last_page_chunk(lastPageChunk) | ||
assert lastPage is not None | ||
lastArvcontinue = lastPage.attrib['arvcontinue'] | ||
print(f'ARVCONTINUE="{lastArvcontinue}"') | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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
This file contains 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