jenkins-bot submitted this change.
[cleanup] remove desupported ReplaceRobot.doReplacements method
Change-Id: I88af611511e26a3821b848efbd8af2919247bd26
---
M scripts/replace.py
M tests/replacebot_tests.py
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/scripts/replace.py b/scripts/replace.py
index 97e2f57..c5f2256 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -142,7 +142,6 @@
#
import codecs
import re
-import warnings
from collections.abc import Sequence
from contextlib import suppress
@@ -154,7 +153,7 @@
from pywikibot import fixes
from pywikibot import i18n, textlib, pagegenerators
from pywikibot.bot import ExistingPageBot, SingleSiteBot
-from pywikibot.tools import chars, deprecated, deprecated_args
+from pywikibot.tools import chars, deprecated_args
# This is required for the text that is shown when you run this script
@@ -621,18 +620,6 @@
return new_text
- @deprecated('apply_replacements', since='20160816', future_warning=True)
- def doReplacements(self, original_text, page=None):
- """Apply replacements to the given text and page."""
- if page is None:
- pywikibot.warn(
- 'You must pass the target page as the "page" parameter to '
- 'doReplacements().', DeprecationWarning, stacklevel=2)
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', DeprecationWarning)
- new_text = self.apply_replacements(original_text, set(), page=page)
- return new_text
-
def _replace_async_callback(self, page, err):
"""Log changed titles for display."""
# This is an async put callback
diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py
index d24e0b3..0d5fe82 100644
--- a/tests/replacebot_tests.py
+++ b/tests/replacebot_tests.py
@@ -10,7 +10,6 @@
import pywikibot
from pywikibot import fixes
-from pywikibot.tools import suppress_warnings
from scripts import replace
@@ -162,8 +161,6 @@
self.assertEqual(expected,
bot.apply_replacements('Hello 1', applied, page))
self.assertEqual(applied, required_applied)
- with suppress_warnings('scripts.replace.ReplaceRobot.doReplacements'):
- self.assertEqual(expected, bot.doReplacements('Hello 1', page))
def test_only_cmd(self):
"""Test command line replacements only."""
To view, visit change 651563. To unsubscribe, or for help writing mail filters, visit settings.