jenkins-bot merged this change.

View Change

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

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

Change-Id: If1bf2491274705f33a0a156fd39367205cff0e98
---
M scripts/delete.py
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/delete.py b/scripts/delete.py
index 78adda2..ec62481 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -187,7 +187,7 @@
"""Process one page from the generator."""
if self.getOption('undelete'):
if self.current_page.exists():
- pywikibot.output(u'Skipping: {0} already exists.'.format(
+ pywikibot.output('Skipping: {0} already exists.'.format(
self.current_page))
else:
self.current_page.undelete(self.summary)
@@ -215,7 +215,7 @@
self.getOption('always'),
quit=True)
else:
- pywikibot.output(u'Skipping: {0} does not exist.'.format(
+ pywikibot.output('Skipping: {0} does not exist.'.format(
self.current_page))


@@ -243,7 +243,7 @@
options['always'] = True
elif arg.startswith('-summary'):
if len(arg) == len('-summary'):
- summary = pywikibot.input(u'Enter a reason for the deletion:')
+ summary = pywikibot.input('Enter a reason for the deletion:')
else:
summary = arg[len('-summary:'):]
elif arg.startswith('-images'):
@@ -292,9 +292,9 @@
# page generator to actually get the text of those pages.
if generator:
if summary is None:
- summary = pywikibot.input(u'Enter a reason for the %sdeletion:'
- % ['', 'un'][options.get('undelete',
- False)])
+ summary = pywikibot.input('Enter a reason for the {}deletion:'
+ .format(['', 'un'][options
+ .get('undelete', False)]))
bot = DeletionRobot(generator, summary, **options)
bot.run()
return True
@@ -303,5 +303,5 @@
return False


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

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

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