jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/462696 )
Change subject: [cleanup] cleanup scripts/fixing_redirects.py ......................................................................
[cleanup] cleanup scripts/fixing_redirects.py
- use str.format(...) instead of modulo for type specifier arguments. - use single quotes for string literals
Change-Id: Ia5f85045a983c050da75d4b60e8c94864051954d --- M scripts/fixing_redirects.py 1 file changed, 6 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py index 0e5c215..f9933104 100755 --- a/scripts/fixing_redirects.py +++ b/scripts/fixing_redirects.py @@ -110,7 +110,7 @@ new_page_title = new_page_title[1:]
if (new_page_title == link_text and not section): - newlink = "[[%s]]" % new_page_title + newlink = '[[{}]]'.format(new_page_title) # check if we can create a link with trailing characters instead of a # pipelink elif (len(new_page_title) <= len(link_text) and @@ -119,10 +119,11 @@ re.sub(re.compile(linktrail), '', link_text[len(new_page_title):]) == '' and not section): - newlink = "[[%s]]%s" % (link_text[:len(new_page_title)], - link_text[len(new_page_title):]) + newlink = '[[{}]]{}'.format(link_text[:len(new_page_title)], + link_text[len(new_page_title):]) else: - newlink = "[[%s%s|%s]]" % (new_page_title, section, link_text) + newlink = '[[{}{}|{}]]'.format(new_page_title, + section, link_text) text = text[:m.start()] + newlink + text[m.end():] continue return text @@ -219,5 +220,5 @@ return False
-if __name__ == "__main__": +if __name__ == '__main__': main()
pywikibot-commits@lists.wikimedia.org