jenkins-bot merged this change.

View Change

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

- removing preleading "u" from strings
- use of str.format(...) instead of modulo in changed lines
- use of single quotes for string literals

Change-Id: I95af5bbfab7d761d6d1f514575ea1bea4ae7c722
---
M scripts/touch.py
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/scripts/touch.py b/scripts/touch.py
index 0e1883b..b2a3cc5 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -46,14 +46,14 @@
try:
page.touch(botflag=self.getOption('botflag'))
except pywikibot.NoPage:
- pywikibot.error(u"Page %s does not exist."
- % page.title(as_link=True))
+ pywikibot.error('Page {0} does not exist.'
+ .format(page.title(as_link=True)))
except pywikibot.LockedPage:
- pywikibot.error(u"Page %s is locked."
- % page.title(as_link=True))
+ pywikibot.error('Page {0} is locked.'
+ .format(page.title(as_link=True)))
except pywikibot.PageNotSaved:
- pywikibot.error(u"Page %s not saved."
- % page.title(as_link=True))
+ pywikibot.error('Page {0} not saved.'
+ .format(page.title(as_link=True)))


class PurgeBot(MultipleSitesBot):
@@ -62,9 +62,8 @@

def treat(self, page):
"""Purge the given page."""
- pywikibot.output(u'Page %s%s purged'
- % (page.title(as_link=True),
- "" if page.purge() else " not"))
+ pywikibot.output('Page {0}{1} purged'.format(
+ page.title(as_link=True), '' if page.purge() else ' not'))


def main(*args):
@@ -88,7 +87,7 @@
if arg == '-purge':
bot_class = PurgeBot
elif arg == '-redir':
- pywikibot.output(u'-redirect option is deprecated, '
+ pywikibot.output('-redirect option is deprecated, '
'do not use it anymore.')
elif not gen_factory.handleArg(arg) and arg.startswith('-'):
# -botflag
@@ -105,5 +104,5 @@
return False


-if __name__ == "__main__":
+if __name__ == '__main__':
main()

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

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