jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/474479 )

Change subject: [PEP8] Fix W504 errors in 3 files
......................................................................

[PEP8] Fix W504 errors in 3 files

Fixed W504 errors in order to have a consistent code style.
This has the consequence of introducing W503 instead.
W504: unary operator at end of line.
W503: unary operator at beginning of line.

Bug: T207836
Change-Id: If6de53d4badfd8e533a56d591aeedff53c8ce975
---
M scripts/casechecker.py
M scripts/solve_disambiguation.py
M scripts/table2wiki.py
3 files changed, 19 insertions(+), 19 deletions(-)

Approvals:
  Framawiki: Looks good to me, but someone else must approve
  Dvorapa: Looks good to me, but someone else must approve
  D3r1ck01: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/casechecker.py b/scripts/casechecker.py
index 51c4904..edce6e7 100755
--- a/scripts/casechecker.py
+++ b/scripts/casechecker.py
@@ -523,8 +523,8 @@
                         c2 = self.lclToLatDict[co]
                     else:
                         c2 = None
-                    kw = [w for w in kw if p < len(w) and
-                          (w[p] == c or (c2 is not None and w[p] == c2))]
+                    kw = [w for w in kw if p < len(w)
+                          and (w[p] == c or (c2 is not None and w[p] == c2))]
                 if len(kw) > 1:
                     pywikibot.output("Word '{}' could be treated as more than "
                                      'one known words'.format(badWord))
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 378e921..c831bb8 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -867,8 +867,8 @@
                 # how many bytes should be displayed around the current link
                 context = 60
                 # check if there's a dn-template here already
-                if (self.dnSkip and self.dn_template_str and
-                        self.dn_template_str[:-2] in text[
+                if (self.dnSkip and self.dn_template_str
+                        and self.dn_template_str[:-2] in text[
                             m.end():m.end() + len(self.dn_template_str) + 8]):
                     continue

@@ -952,9 +952,9 @@
                     else:
                         position_split = 0
                     # insert dab needed template
-                    text = (text[:m.end() + position_split] +
-                            self.dn_template_str +
-                            text[m.end() + position_split:])
+                    text = (text[:m.end() + position_split]
+                            + self.dn_template_str
+                            + text[m.end() + position_split:])
                     dn = True
                     continue
                 elif answer == 'u':
@@ -995,12 +995,12 @@
                     # check if we can create a link with trailing characters
                     # instead of a pipelink
                     elif (
-                        (len(new_page_title) <= len(link_text)) and
-                        (firstcap(link_text[:len(new_page_title)]) ==
-                         firstcap(new_page_title)) and
-                        (self.trailR.sub(
-                            '', link_text[len(new_page_title):]) == '') and
-                        (not section)
+                        (len(new_page_title) <= len(link_text))
+                        and (firstcap(link_text[:len(new_page_title)])
+                             == firstcap(new_page_title))
+                        and (self.trailR.sub(
+                            '', link_text[len(new_page_title):]) == '')
+                        and (not section)
                     ):
                         newlink = '[[{0}]]{1}'.format(
                             link_text[:len(new_page_title)],
@@ -1133,8 +1133,8 @@
                                        'solve_disambiguation-unknown-page')

         # first check whether user has customized the edit comment
-        if (self.mysite.family.name in config.disambiguation_comment and
-                self.mylang in config.disambiguation_comment[
+        if (self.mysite.family.name in config.disambiguation_comment
+                and self.mylang in config.disambiguation_comment[
                     self.mysite.family.name]):
             try:
                 self.comment = i18n.translate(
diff --git a/scripts/table2wiki.py b/scripts/table2wiki.py
index 91bd44e..8cc47ad 100644
--- a/scripts/table2wiki.py
+++ b/scripts/table2wiki.py
@@ -426,8 +426,8 @@
                         'More opening than closing table tags. Skipping.')
                     return None, 0, 0
                 # if another table tag is opened before one is closed
-                elif (next_starting and
-                      next_starting.start() < next_ending.start()):
+                elif (next_starting
+                      and next_starting.start() < next_ending.start()):
                     offset += next_starting.end()
                     text = text[next_starting.end():]
                     depth += 1
@@ -508,8 +508,8 @@
                 {'count': warnings}
             )
         self.put_current(new_text, summary=edit_summary,
-                         show_diff=not (self.getOption('quiet') and
-                                        self.getOption('always')))
+                         show_diff=not (self.getOption('quiet')
+                                        and self.getOption('always')))

 
 _marked_table_start_search = re.compile('<##table##', re.IGNORECASE).search

--
To view, visit https://gerrit.wikimedia.org/r/474479
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If6de53d4badfd8e533a56d591aeedff53c8ce975
Gerrit-Change-Number: 474479
Gerrit-PatchSet: 1
Gerrit-Owner: Nils ANDRE <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to