Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
read_titles() always return string
  • Loading branch information
yzqzss committed Dec 4, 2024
1 parent c0dae4c commit 9c425e5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions wikiteam3/dumpgenerator/dump/page/xmlrev/xml_revisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,9 @@ def getXMLRevisionsByTitles(config: Config, session: requests.Session, site: mwc
titlelist = []
# TODO: Decide a suitable number of a batched request. Careful:
# batched responses may not return all revisions.
for titlelist in read_titles(config, session=session, start=start):
if isinstance(titlelist, str):
titlelist = [titlelist]
for title in titlelist:
print(f" {title}")
for title in read_titles(config, session=session, start=start):
print(f" {title}")
titlelist = [title]
# Try and ask everything. At least on MediaWiki 1.16, uknown props are discarded:
# "warnings":{"revisions":{"*":"Unrecognized values for parameter 'rvprop': userid, sha1, contentmodel"}}}
pparams = {
Expand Down

0 comments on commit 9c425e5

Please sign in to comment.