jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/433587 )
Change subject: DayPageGenerator: Deprecate startMonth and endMonth ......................................................................
DayPageGenerator: Deprecate startMonth and endMonth
Follow-up to 65f408f2f22003633df6299c4fccae3b4a77b6bd which has caused tests to fail deprecate `startMonth` and `endMonth` parameters of `DayPageGenerator` in favour of `start_month` and `end_month`. The former forms violate PEP8 (N803 errors which we currently ignore).
Change-Id: I51c45bea1dede1ae0110f7ce9af186e1c6cb0439 --- M pywikibot/pagegenerators.py 1 file changed, 4 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 8208fad..108b979 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -2802,7 +2802,8 @@ yield pywikibot.Page(pywikibot.Link(current_year, site))
-def DayPageGenerator(startMonth=1, endMonth=12, site=None, year=2000): +@deprecated_args(startMonth='start_month', endMonth='end_month') +def DayPageGenerator(start_month=1, end_month=12, site=None, year=2000): """ Day page generator.
@@ -2814,9 +2815,9 @@ if site is None: site = pywikibot.Site() fd = date.FormatDate(site) - firstPage = pywikibot.Page(site, fd(startMonth, 1)) + firstPage = pywikibot.Page(site, fd(start_month, 1)) pywikibot.output(u"Starting with %s" % firstPage.title(asLink=True)) - for month in range(startMonth, endMonth + 1): + for month in range(start_month, end_month + 1): for day in range(1, calendar.monthrange(year, month)[1] + 1): yield pywikibot.Page(pywikibot.Link(fd(month, day), site))
pywikibot-commits@lists.wikimedia.org