jenkins-bot has submitted this change and it was merged.

Change subject: pep8-ified scripts/cosmetic_changes.py
......................................................................


pep8-ified scripts/cosmetic_changes.py

Change-Id: I7e2d277215f5ef054d752f30243ea223c5eb0528
---
M scripts/cosmetic_changes.py
1 file changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 9d96562..5acb8ee 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -375,7 +375,8 @@
                               'img_right', 'img_none', 'img_framed',
                               'img_frameless', 'img_border', 'img_upright', ]:
                 aliases = self.site.getmagicwords(magicWord)
-                if not aliases: continue
+                if not aliases:
+                    continue
                 text = pywikibot.replaceExcept(
                     text,
                     r'\[\[(?P<left>.+?:.+?\..+?\|) *(' + '|'.join(aliases) + \
@@ -460,10 +461,10 @@
                         newLink = "[[%s]]" % label
                     # Check if we can create a link with trailing characters
                     # instead of a pipelink
-                    elif len(titleWithSection) <= len(label) and \
-                             label[:len(titleWithSection)] == titleWithSection 
\
-                             and re.sub(trailR, '',
-                                        label[len(titleWithSection):]) == '':
+                    elif (len(titleWithSection) <= len(label) and
+                          label[:len(titleWithSection)] == titleWithSection and
+                          re.sub(trailR, '', label[len(titleWithSection):]) == 
''
+                          ):
                         newLink = "[[%s]]%s" % (label[:len(titleWithSection)],
                                                 label[len(titleWithSection):])
                     else:
@@ -472,8 +473,7 @@
                         # don't capitalize nouns...
                         #if not self.site.nocapitalize:
                         if self.site.sitename() == 'wikipedia:de':
-                            titleWithSection = titleWithSection[0].upper() + \
-                                               titleWithSection[1:]
+                            titleWithSection = titleWithSection[0].upper() + 
titleWithSection[1:]
                         newLink = "[[%s|%s]]" % (titleWithSection, label)
                     # re-add spaces that were pulled out of the link.
                     # Examples:
@@ -879,7 +879,8 @@
     def run(self):
         try:
             for page in self.generator:
-                if self.done: break
+                if self.done:
+                    break
                 self.treat(page)
         except KeyboardInterrupt:
             pywikibot.output('\nQuitting program...')

-- 
To view, visit https://gerrit.wikimedia.org/r/80846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e2d277215f5ef054d752f30243ea223c5eb0528
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to