jenkins-bot merged this change.

View Change

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

- remove preleading "u" from strings
- use single quotes for string literals
- appending using the "+" symbol

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

diff --git a/scripts/templatecount.py b/scripts/templatecount.py
index 8a79cc9..cff7f82 100755
--- a/scripts/templatecount.py
+++ b/scripts/templatecount.py
@@ -92,14 +92,14 @@
template_dict = cls.template_dict(templates, namespaces)
pywikibot.stdout('\nList of pages transcluding templates:')
for key in templates:
- pywikibot.output(u'* %s' % key)
+ pywikibot.output('* ' + key)
pywikibot.stdout('-' * 36)
total = 0
for key in template_dict:
for page in template_dict[key]:
pywikibot.stdout(page.title())
total += 1
- pywikibot.output(u'Total page count: %d' % total)
+ pywikibot.output('Total page count: {0}'.format(total))
pywikibot.stdout('Report generated on {0}'
''.format(datetime.datetime.utcnow().isoformat()))

@@ -181,9 +181,9 @@

if 'reflist' in args_list:
pywikibot.output(
- u'NOTE: it will take a long time to count "reflist".')
+ 'NOTE: it will take a long time to count "reflist".')
choice = pywikibot.input_choice(
- u'Proceed anyway?',
+ 'Proceed anyway?',
[('yes', 'y'), ('no', 'n'), ('skip', 's')], 'y',
automatic_quit=False)
if choice == 's':
@@ -191,11 +191,11 @@
elif choice == 'n':
return

- if operation == "count":
+ if operation == 'count':
robot.countTemplates(args_list, namespaces)
- elif operation == "list":
+ elif operation == 'list':
robot.listTemplates(args_list, namespaces)


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

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

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