jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/434866 )
Change subject: Fix N806 errors within for loops ......................................................................
Fix N806 errors within for loops
These errors will be detected with the next release of pep-naming. Better to fix them now, before they break the tests.
Change-Id: I35b64f4782a6c9d0d2309ad981bba709a958efeb --- M scripts/followlive.py M scripts/login.py M scripts/makecat.py M tests/date_tests.py 4 files changed, 12 insertions(+), 12 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/followlive.py b/scripts/followlive.py index 488c6ec..5f7e3a2 100644 --- a/scripts/followlive.py +++ b/scripts/followlive.py @@ -527,9 +527,9 @@
def run(self): """Process all pages in generator.""" - for (page, date, length, loggedIn, username, + for (page, date, length, logged_in, username, comment) in self.site.newpages(): - self.handle_page(page, date, length, loggedIn, username) + self.handle_page(page, date, length, logged_in, username)
def main(*args): diff --git a/scripts/login.py b/scripts/login.py index 0868cce..ece0701 100755 --- a/scripts/login.py +++ b/scripts/login.py @@ -166,10 +166,10 @@ else: site = pywikibot.Site() namedict = {site.family.name: {site.code: None}} - for familyName in namedict: - for lang in namedict[familyName]: + for family_name in namedict: + for lang in namedict[family_name]: try: - site = pywikibot.Site(code=lang, fam=familyName) + site = pywikibot.Site(code=lang, fam=family_name) if oauth: _oauth_login(site) continue @@ -189,7 +189,7 @@ 'Not logged in on {0}.'.format(site)) except SiteDefinitionError: pywikibot.output(u'%s.%s is not a valid site, please remove it' - u' from your config' % (lang, familyName)) + ' from your config' % (lang, family_name))
if __name__ == "__main__": diff --git a/scripts/makecat.py b/scripts/makecat.py index 4f2e867..14f7997 100755 --- a/scripts/makecat.py +++ b/scripts/makecat.py @@ -100,10 +100,10 @@ tocheck.append(page2) checked[page2] = page2 if checkbackward: - for refPage in pl.getReferences(): - if needcheck(refPage): - tocheck.append(refPage) - checked[refPage] = refPage + for ref_page in pl.getReferences(): + if needcheck(ref_page): + tocheck.append(ref_page) + checked[ref_page] = ref_page
def asktoadd(pl, summary): diff --git a/tests/date_tests.py b/tests/date_tests.py index 7b01951..672649b 100644 --- a/tests/date_tests.py +++ b/tests/date_tests.py @@ -33,14 +33,14 @@ except KeyError: return
- for code, convFunc in date.formats[formatname].items(): + for code, convert in date.formats[formatname].items(): for value in range(start, stop, step): self.assertTrue( predicate(value), "date.formats['%s']['%s']:\ninvalid value %d" % (formatname, code, value))
- new_value = convFunc(convFunc(value)) + new_value = convert(convert(value)) self.assertEqual( new_value, value, "date.formats['%s']['%s']:\n"