jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462318 )
Change subject: [cleanup] cleanup scripts/revertbot.py
......................................................................
[cleanup] cleanup scripts/revertbot.py
- remove preleading "u" from strings
- use str.format(...) instead of modulo for type specifier
arguments
- use single quotes for string literals
Change-Id: I894f7e469b7659f50b35eb6b9908a5defce89ab8
---
M scripts/revertbot.py
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index f6c4e07..cf4d0b6 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -79,11 +79,11 @@
if callback(item):
result = self.revert(item)
if result:
- self.log(u'%s: %s' % (item['title'], result))
+ self.log('{0}: {1}'.format(item['title'], result))
else:
- self.log(u'Skipped %s' % item['title'])
+ self.log('Skipped {0}'.format(item['title']))
else:
- self.log(u'Skipped %s by callback' % item['title'])
+ self.log('Skipped {0} by callback'.format(item['title']))
def callback(self, item):
"""Callback function."""
@@ -127,8 +127,8 @@
else:
pywikibot.exception()
return False
- return 'The edit(s) made in %s by %s was rollbacked' % (page.title(),
- self.user)
+ return 'The edit(s) made in {0} by {1} was rollbacked'.format(
+ page.title(), self.user)
def log(self, msg):
"""Log the message msg."""
@@ -153,7 +153,7 @@
if arg.startswith('-username'):
if len(arg) == 9:
user = pywikibot.input(
- u'Please enter username of the person you want to revert:')
+ 'Please enter username of the person you want to revert:')
else:
user = arg[10:]
elif arg == '-rollback':
@@ -162,5 +162,5 @@
bot.revert_contribs()
-if __name__ == "__main__":
+if __name__ == '__main__':
main()
--
To view, visit https://gerrit.wikimedia.org/r/462318
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: I894f7e469b7659f50b35eb6b9908a5defce89ab8
Gerrit-Change-Number: 462318
Gerrit-PatchSet: 4
Gerrit-Owner: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <alangiderick(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)