jenkins-bot submitted this change.
[IMPR] Remove remaining color_format usage
Change-Id: I48efc0e1d32d1a08707f79a0bd3c3d358e4c32c2
---
M pywikibot/bot_choice.py
M scripts/delinker.py
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index c59ba79..a1b3ac6 100644
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -594,16 +594,18 @@
self.text[self.end:end],
color=self.color)
- @deprecated('pywikibot.output(HighlightContextOption.out)',
- since='6.2.0')
+ @deprecated('pywikibot.output(HighlightContextOption.out)', since='6.2.0')
def output_range(self, start: int, end: int) -> None:
- """DEPRECATED. Show normal context with a highlighted center region."""
- color_format = pywikibot.tools.formatter.color_format
- text = color_format('{}{%(color)s}{}{default}{}'
- % {'color': self.color},
- self.text[start:self.start],
- self.text[self.start:self.end],
- self.text[self.end:end])
+ """Show normal context with a highlighted center region.
+
+ .. deprecated:: 6.2
+ use :attr:`out` instead.
+ """
+ text = '{}<<{color}>>{}<<default>>{}'.format(
+ self.text[start:self.start],
+ self.text[self.start:self.end],
+ self.text[self.end:end],
+ color=self.color)
pywikibot.output(text)
diff --git a/scripts/delinker.py b/scripts/delinker.py
index 9ee7e59..fe43cbe 100644
--- a/scripts/delinker.py
+++ b/scripts/delinker.py
@@ -47,7 +47,6 @@
calledModuleName,
)
from pywikibot.textlib import case_escape, ignore_case, replaceExcept
-from pywikibot.tools.formatter import color_format
class CommonsDelinker(SingleSiteBot, ConfigParserBot, AutomaticTWSummaryBot):
@@ -113,8 +112,8 @@
for page in file_page.usingPages(content=True, namespaces=0):
if not shown:
pywikibot.output(
- color_format('\n>>> {lightgreen}Delinking {}{default} <<<',
- file_page.title()))
+ '\n>>> <<lightgreen>>Delinking {}<<default>> <<<'
+ .format(file_page.title()))
shown = True
super().treat(page)
To view, visit change 784269. To unsubscribe, or for help writing mail filters, visit settings.