jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462544 )
Change subject: [cleanup] cleanup scripts/imagetransger.py ......................................................................
[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(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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()