jenkins-bot merged this change.

View Change

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

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

Change-Id: Iee0594ceefdca570585c2e933f385b6ba485fc6d
---
M scripts/imagetransfer.py
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
index 3696a31..16189ab 100755
--- a/scripts/imagetransfer.py
+++ b/scripts/imagetransfer.py
@@ -141,7 +141,7 @@
"""
sourceSite = sourceImagePage.site
url = sourceImagePage.fileUrl().encode('utf-8')
- pywikibot.output(u"URL should be: %s" % url)
+ pywikibot.output('URL should be: ' + url)
# localize the text that should be printed on image description page
try:
description = sourceImagePage.get()
@@ -209,8 +209,8 @@
"""Print image list."""
for i, image in enumerate(imagelist):
pywikibot.output('-' * 60)
- pywikibot.output('%s. Found image: %s'
- % (i, image.title(as_link=True)))
+ pywikibot.output('{}. Found image: {}'
+ .format(i, image.title(as_link=True)))
try:
# Show the image description page's contents
pywikibot.output(image.get())
@@ -223,8 +223,8 @@
targetTitle = 'File:' + image.title().split(':', 1)[1]
targetImage = pywikibot.Page(self.targetSite, targetTitle)
targetImage.get()
- pywikibot.output('Image with this name is already on %s.'
- % self.targetSite)
+ pywikibot.output('Image with this name is already on {}.'
+ .format(self.targetSite))
pywikibot.output('-' * 60)
pywikibot.output(targetImage.get())
sys.exit()
@@ -332,5 +332,5 @@
bot.run()


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

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iee0594ceefdca570585c2e933f385b6ba485fc6d
Gerrit-Change-Number: 462544
Gerrit-PatchSet: 1
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)