jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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(-)

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))

To view, visit change 433587. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I51c45bea1dede1ae0110f7ce9af186e1c6cb0439
Gerrit-Change-Number: 433587
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>