jenkins-bot has submitted this change and it was merged.
Change subject: redirect.py: Give a more precise user message ......................................................................
redirect.py: Give a more precise user message
When redirect broken is running without -delete option a "Won't delete anything" sounds odd. Print a different message if this switch is off.
Change-Id: Ibdb431665cf5c0d66b5d414d5aa16da8fd01c37c --- M scripts/redirect.py 1 file changed, 9 insertions(+), 5 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/redirect.py b/scripts/redirect.py index 93f2b55..efdf972 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -496,15 +496,19 @@ else: pywikibot.output(u'Cannot fix or delete the broken redirect') except pywikibot.IsRedirectPage: - pywikibot.output(u"Redirect target %s is also a redirect! " - u"Won't delete anything." - % targetPage.title(asLink=True)) + pywikibot.output( + "Redirect target {{0}} is also a redirect! {{1}}".format( + targetPage.title(asLink=True), + "Won't delete anything." + if self.getOption('delete') else "Skipping.")) else: # we successfully get the target page, meaning that # it exists and is not a redirect: no reason to touch it. pywikibot.output( - u'Redirect target %s does exist! Won't delete anything.' - % targetPage.title(asLink=True)) + "Redirect target {{0}} does exist! {{1}}".format( + targetPage.title(asLink=True), + "Won't delete anything." + if self.getOption('delete') else "Skipping."))
def fix_double_redirects(self): for redir_name in self.generator.retrieve_double_redirects():
pywikibot-commits@lists.wikimedia.org