jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462756 )
Change subject: [cleanup] cleanup scripts/coordinate_import.py ......................................................................
[cleanup] cleanup scripts/coordinate_import.py
- use str.format(...) instead of modulo for type specifier arguments. - use single quotes for string literals - remove preleading "u" from strings
Change-Id: I81745c3d1315c42795cd447a0c5d9f616a869872 --- M scripts/coordinate_import.py 1 file changed, 10 insertions(+), 10 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py index 577568a..a82a59b 100755 --- a/scripts/coordinate_import.py +++ b/scripts/coordinate_import.py @@ -84,22 +84,22 @@
claims = item.get().get('claims') if self.prop in claims: - pywikibot.output(u'Item %s already contains coordinates (%s)' - % (item.title(), self.prop)) + pywikibot.output('Item {} already contains coordinates ({})' + .format(item.title(), self.prop)) return
prop = self.has_coord_qualifier(claims) if prop: - pywikibot.output(u'Item %s already contains coordinates' - u' (%s) as qualifier for %s' - % (item.title(), self.prop, prop)) + pywikibot.output('Item {} already contains coordinates' + ' ({}) as qualifier for {}' + .format(item.title(), self.prop, prop)) return
newclaim = pywikibot.Claim(self.repo, self.prop) newclaim.setTarget(coordinate) - pywikibot.output(u'Adding %s, %s to %s' % (coordinate.lat, - coordinate.lon, - item.title())) + pywikibot.output('Adding {}, {} to {}'.format(coordinate.lat, + coordinate.lon, + item.title())) try: item.addClaim(newclaim)
@@ -107,7 +107,7 @@ if source: newclaim.addSource(source, bot=True) except CoordinateGlobeUnknownException as e: - pywikibot.output(u'Skipping unsupported globe: %s' % e.args) + pywikibot.output('Skipping unsupported globe: {}'.format(e.args))
def main(*args): @@ -141,5 +141,5 @@ return False
-if __name__ == "__main__": +if __name__ == '__main__': main()
pywikibot-commits@lists.wikimedia.org