jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/639303 )
Change subject: [IMPR] reduce code complexity of pagegenerators.py ......................................................................
[IMPR] reduce code complexity of pagegenerators.py
Change-Id: I135fb03c04c4ea797f61dc5da891c8eb62856c7f --- M pywikibot/pagegenerators.py 1 file changed, 5 insertions(+), 6 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 2af367f..3bae2b5 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -1939,12 +1939,11 @@ max_revision_depth @param show_filtered: Output a message for each page not yielded """ - ts = None - if timestamp: - if isinstance(timestamp, str): - ts = pywikibot.Timestamp.fromtimestampformat(timestamp) - else: - ts = timestamp + if isinstance(timestamp, str): + ts = pywikibot.Timestamp.fromtimestampformat(timestamp) + else: + ts = timestamp + for page in generator: contribs = page.contributors(total=max_revision_depth, endtime=ts) if bool(contribs[username]) is not bool(skip): # xor operation
pywikibot-commits@lists.wikimedia.org