From 0b42643701410badbcd8d62de6c44df10bc19f15 Mon Sep 17 00:00:00 2001 From: yzqzss Date: Mon, 29 May 2023 14:09:25 +0800 Subject: [PATCH] --xmlapiexport: xml: add --- wikiteam3/dumpgenerator/dump/page/xmlexport/page_xml_api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wikiteam3/dumpgenerator/dump/page/xmlexport/page_xml_api.py b/wikiteam3/dumpgenerator/dump/page/xmlexport/page_xml_api.py index c4a248e..16d132d 100644 --- a/wikiteam3/dumpgenerator/dump/page/xmlexport/page_xml_api.py +++ b/wikiteam3/dumpgenerator/dump/page/xmlexport/page_xml_api.py @@ -25,8 +25,14 @@ def reconstructRevisions(root=None): for rev in root.find('query').find('pages').find('page').find('revisions').findall('rev'): try: rev_ = ET.SubElement(page,'revision') + # id ET.SubElement(rev_,'id').text = rev.attrib['revid'] + # parentid (optional, export-0.7+) + if 'parentid' in rev.attrib: + ET.SubElement(rev_,'parentid').text = rev.attrib['parentid'] + # timestamp ET.SubElement(rev_,'timestamp').text = rev.attrib['timestamp'] + # contributor contributor = ET.SubElement(rev_,'contributor') if 'userhidden' not in rev.attrib: ET.SubElement(contributor,'username').text = rev.attrib['user']