Skip to content

Commit 9c425e5

Browse files
committed
minor refactor
read_titles() always return string
1 parent c0dae4c commit 9c425e5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: wikiteam3/dumpgenerator/dump/page/xmlrev/xml_revisions.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,9 @@ def getXMLRevisionsByTitles(config: Config, session: requests.Session, site: mwc
320320
titlelist = []
321321
# TODO: Decide a suitable number of a batched request. Careful:
322322
# batched responses may not return all revisions.
323-
for titlelist in read_titles(config, session=session, start=start):
324-
if isinstance(titlelist, str):
325-
titlelist = [titlelist]
326-
for title in titlelist:
327-
print(f" {title}")
323+
for title in read_titles(config, session=session, start=start):
324+
print(f" {title}")
325+
titlelist = [title]
328326
# Try and ask everything. At least on MediaWiki 1.16, uknown props are discarded:
329327
# "warnings":{"revisions":{"*":"Unrecognized values for parameter 'rvprop': userid, sha1, contentmodel"}}}
330328
pparams = {

0 commit comments

Comments
 (0)