jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462434 )
Change subject: [cleanup] cleanup scripts/protect.py ......................................................................
[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(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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
pywikibot-commits@lists.wikimedia.org