jenkins-bot merged this change.

View Change

Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
[simplify] use verbose_output method

follow-up of cad9b0b00

Change-Id: I5c68b239c50cfa0cd12cfa098848292afb9193b0
---
M scripts/patrol.py
1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/scripts/patrol.py b/scripts/patrol.py
index 77f1205..8704d6d 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -344,8 +344,7 @@
pywikibot.output('Patrolled {0} (rcid {1}) by user {2}'
.format(title, rcid, username))
else:
- if pywikibot.config.verbose_output:
- pywikibot.output('Skipped')
+ verbose_output('Skipped')

if rcid > self.highest_rcid:
self.highest_rcid = rcid
@@ -387,24 +386,19 @@
raise Exception('This is a wikisource rule')

if not self.linkedpages:
- if pywikibot.config.verbose_output:
- pywikibot.output('loading page links on ' + self.page_title)
+ verbose_output('loading page links on ' + self.page_title)
p = pywikibot.Page(self.site, self.page_title)
linkedpages = []
for linkedpage in p.linkedPages():
linkedpages.append(linkedpage.title())

self.linkedpages = linkedpages
- if pywikibot.config.verbose_output:
- pywikibot.output('Loaded {0} page links'
- .format(len(linkedpages)))
+ verbose_output('Loaded {0} page links'.format(len(linkedpages)))

for p in self.linkedpages:
- if pywikibot.config.verbose_output:
- pywikibot.output("Checking against '{0}'".format(p))
+ verbose_output("Checking against '{0}'".format(p))
if page_title.startswith(p):
- if pywikibot.config.verbose_output:
- pywikibot.output('Matched.')
+ verbose_output('Matched.')
return p



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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5c68b239c50cfa0cd12cfa098848292afb9193b0
Gerrit-Change-Number: 467919
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)