jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] cleanup scripts/protect.py

- remove preleading "u" from strings
- use str.format(...) instead of modulo for type specifier
arguments

Change-Id: I78b87e2e7e2774a754fd0f88e2f6f2f8d3a822d0
---
M scripts/protect.py
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/protect.py b/scripts/protect.py
index e8e0f8a..66988f8 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -105,8 +105,8 @@
"""
self.current_page = page
if not self.user_confirm(
- 'Do you want to change the protection level of %s?'
- % page.title(as_link=True, force_interwiki=True)):
+ 'Do you want to change the protection level of {0}?'
+ .format(page.title(as_link=True, force_interwiki=True))):
return
applicable = page.applicable_protections()
protections = dict(
@@ -136,8 +136,9 @@
num += 1
if level == default:
default_char = first_char[-1]
- choice = pywikibot.input_choice('Choice a protection level to %s:'
- % operation, zip(levels, first_char),
+ choice = pywikibot.input_choice('Choice a protection level to {0}:'
+ .format(operation),
+ zip(levels, first_char),
default=default_char)

return levels[first_char.index(choice)]
@@ -258,7 +259,7 @@
combined_protections[p_type] = level
if not options.get('summary'):
options['summary'] = pywikibot.input(
- u'Enter a reason for the protection change:')
+ 'Enter a reason for the protection change:')
bot = ProtectionRobot(generator, combined_protections, site, **options)
bot.run()
return True

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I78b87e2e7e2774a754fd0f88e2f6f2f8d3a822d0
Gerrit-Change-Number: 462434
Gerrit-PatchSet: 2
Gerrit-Owner: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)