jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[PEP8] Fix W504 errors in scripts/interwiki.py

Fixed the W504 error occurrences in the following file:
- scripts/interwiki.py

Bug: T207836
Change-Id: I705097ee01f477ebfad278de404daf458d393118
---
M scripts/interwiki.py
1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index f8909bd..725cffc 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -985,8 +985,8 @@
if linkedPage in self.foundIn:
# We have seen this page before, don't ask again.
return False
- elif (self.originPage and
- self.originPage.namespace() != linkedPage.namespace()):
+ if (self.originPage
+ and self.originPage.namespace() != linkedPage.namespace()):
# Allow for a mapping between different namespaces
crossFrom = self.originPage.site.family.crossnamespace.get(
self.originPage.namespace(), {})
@@ -1060,9 +1060,9 @@
pywikibot.output('NOTE: Ignoring {} for {} in wiktionary mode'
.format(page, self.originPage))
return True
- elif (page.title() != self.originPage.title() and
- self.originPage.namespace().case == 'case-sensitive' and
- page.namespace().case == 'case-sensitive'):
+ if (page.title() != self.originPage.title()
+ and self.originPage.namespace().case == 'case-sensitive'
+ and page.namespace().case == 'case-sensitive'):
pywikibot.output(
'NOTE: Ignoring {} for {} in wiktionary mode because both '
'languages are uncapitalized.'
@@ -1296,8 +1296,9 @@
elif page.isStaticRedirect():
self.conf.note('not following static {}redirects.'
.format(redir))
- elif (page.site.family == redirectTargetPage.site.family and
- not self.skipPage(page, redirectTargetPage, counter)):
+ elif (page.site.family == redirectTargetPage.site.family
+ and not self.skipPage(page, redirectTargetPage,
+ counter)):
if self.addIfNew(redirectTargetPage, counter, page):
if config.interwiki_shownew:
pywikibot.output('{}: {} gives new {}redirect {}'
@@ -1626,8 +1627,9 @@
(not frgnSiteDone and site != lclSite and site in new):
if site == lclSite:
lclSiteDone = True # even if we fail the update
- if (site.family.name in config.usernames and
- site.code in config.usernames[site.family.name]):
+ if (site.family.name in config.usernames
+ and site.code in config.usernames[
+ site.family.name]):
try:
if self.replaceLinks(new[site], new):
updatedSites.append(site)
@@ -1637,9 +1639,8 @@
notUpdatedSites.append(site)
except GiveUpOnPage:
break
- elif (not self.conf.strictlimittwo and
- site in new and
- site != lclSite):
+ elif (not self.conf.strictlimittwo
+ and site in new and site != lclSite):
old = {}
try:
for link in new[site].iterlanglinks():
@@ -1652,12 +1653,12 @@
mods, mcomment, adding, removing, modifying \
= compareLanguages(old, new, lclSite,
self.conf.summary)
- if ((len(removing) > 0 and not self.conf.autonomous) or
- (len(modifying) > 0 and self.problemfound) or
- (len(old) == 0) or
- (self.conf.needlimit and
- len(adding) + len(modifying) >=
- self.conf.needlimit + 1)):
+ if (len(removing) > 0 and not self.conf.autonomous
+ or len(modifying) > 0 and self.problemfound
+ or len(old) == 0
+ or (self.conf.needlimit
+ and len(adding) + len(modifying)
+ >= self.conf.needlimit + 1)):
try:
if self.replaceLinks(new[site], new):
updatedSites.append(site)
@@ -1809,8 +1810,8 @@
rmPage = old[rmsite]
# put it to new means don't delete it
if (
- not self.conf.cleanup or
- unicode(rmPage) not in self.conf.remove
+ not self.conf.cleanup
+ or unicode(rmPage) not in self.conf.remove
):
new[rmsite] = rmPage
pywikibot.warning(
@@ -2426,8 +2427,8 @@
elif arg.startswith('-years'):
# Look if user gave a specific year at which to start
# Must be a natural number or negative integer.
- if len(arg) > 7 and (arg[7:].isdigit() or
- (arg[7] == '-' and arg[8:].isdigit())):
+ if len(arg) > 7 and (arg[7:].isdigit()
+ or (arg[7] == '-' and arg[8:].isdigit())):
startyear = int(arg[7:])
else:
startyear = 1

To view, visit change 475588. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I705097ee01f477ebfad278de404daf458d393118
Gerrit-Change-Number: 475588
Gerrit-PatchSet: 3
Gerrit-Owner: Nathan fraignt <nathanklumpenaar10@outlook.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Nathan fraignt <nathanklumpenaar10@outlook.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)