jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100143?usp=email )

Change subject: cleanup: remove deprecated RedirectPageBot and NoRedirectPageBot
......................................................................

cleanup: remove deprecated RedirectPageBot and NoRedirectPageBot

Change-Id: I550b8b068c241db39285460928a4380e0e02fb93
---
M ROADMAP.rst
M pywikibot/bot.py
2 files changed, 8 insertions(+), 59 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/ROADMAP.rst b/ROADMAP.rst
index 756468c..d151e04 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -11,6 +11,8 @@

 **Breaking changes and code cleanups**

+* 7.2.0: RedirectPageBot and NoRedirectPageBot bot classes were removed in 
favour of
+  :attr:`use_redirects<bot.BaseBot.use_redirects>` attribute
 * Python 3.7 support was dropped (:phab:`T378893`)


@@ -95,8 +97,6 @@
 * 7.2.0: ``tb`` parameter of :func:`exception()<pywikibot.logging.exception>` 
function was renamed to ``exc_info``
 * 7.2.0: XMLDumpOldPageGenerator is deprecated in favour of a ``content`` 
parameter of
   :func:`XMLDumpPageGenerator<pagegenerators.XMLDumpPageGenerator>` 
(:phab:`T306134`)
-* 7.2.0: RedirectPageBot and NoRedirectPageBot bot classes are deprecated in 
favour of
-  :attr:`use_redirects<bot.BaseBot.use_redirects>` attribute
 * 7.2.0: :func:`tools.formatter.color_format<tools.formatter.color_format>` is 
deprecated and will be removed
 * 7.1.0: Unused ``get_redirect`` parameter of 
:meth:`Page.getOldVersion()<page.BasePage.getOldVersion>` will be removed
 * 7.0.0: User.isBlocked() method is renamed to is_blocked for consistency
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 6e9efa8..952848e 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -55,11 +55,6 @@
 subclasses :class:`CurrentPageBot` and automatically defines the summary
 when :meth:`put_current` is used.

-.. deprecated:: 7.2
-   The bot classes :class:`RedirectPageBot` and
-   :class:`NoRedirectPageBot` are deprecated. Use
-   :attr:`use_redirects<BaseBot.use_redirects>` attribute instead.
-
 .. deprecated:: 9.2
    The functions
    :func:`critical()<pywikibot.logging.critical>`
@@ -78,6 +73,11 @@
    and ``WARNING`` imported from :mod:`logging` module are deprecated
    within this module. Import them directly. These functions can also be
    used as :mod:`pywikibot` members.
+
+.. versionremoved:: 10.0
+   The bot classes :class:`RedirectPageBot` and
+   :class:`NoRedirectPageBot` are deprecated. Use
+   :attr:`use_redirects<BaseBot.use_redirects>` attribute instead.
 """
 #
 # (C) Pywikibot team, 2008-2024
@@ -105,7 +105,6 @@
     'BaseBot', 'Bot', 'ConfigParserBot', 'SingleSiteBot', 'MultipleSitesBot',
     'CurrentPageBot', 'AutomaticTWSummaryBot',
     'ExistingPageBot', 'FollowRedirectPageBot', 'CreatingPageBot',
-    'RedirectPageBot', 'NoRedirectPageBot',
     'WikidataBot',
 )

@@ -189,7 +188,7 @@
 from pywikibot.logging import stdout as _stdout
 from pywikibot.logging import warning as _warning
 from pywikibot.throttle import Throttle
-from pywikibot.tools import issue_deprecation_warning, redirect_func, strtobool
+from pywikibot.tools import redirect_func, strtobool
 from pywikibot.tools._logging import LoggingFormatter


@@ -1937,56 +1936,6 @@
         return super().skip_page(page)


-class RedirectPageBot(CurrentPageBot):  # pragma: no cover
-
-    """A RedirectPageBot class which only treats redirects.
-
-    .. deprecated:: 7.2
-       use BaseBot attribute
-       :attr:`use_redirects  = True<BaseBot.use_redirects>` instead
-    """
-
-    def __init__(self, *args, **kwargs):
-        """Deprecate RedirectPageBot."""
-        issue_deprecation_warning('RedirectPageBot',
-                                  "BaseBot attribute 'use_redirects = True'",
-                                  since='7.2.0')
-        super().__init__(*args, **kwargs)
-
-    def skip_page(self, page: pywikibot.page.BasePage) -> bool:
-        """Treat only redirect pages and handle IsNotRedirectPageError."""
-        if not page.isRedirectPage():
-            _warning(f'Page {page} on {page.site} is skipped because it is'
-                     ' not a redirect')
-            return True
-        return super().skip_page(page)
-
-
-class NoRedirectPageBot(CurrentPageBot):  # pragma: no cover
-
-    """A NoRedirectPageBot class which only treats non-redirects.
-
-    .. deprecated:: 7.2
-       use BaseBot attribute
-       :attr:`use_redirects  = False<BaseBot.use_redirects>` instead
-    """
-
-    def __init__(self, *args, **kwargs):
-        """Deprecate NoRedirectPageBot."""
-        issue_deprecation_warning('NoRedirectPageBot',
-                                  "BaseBot attribute 'use_redirects = False'",
-                                  since='7.2.0')
-        super().__init__(*args, **kwargs)
-
-    def skip_page(self, page: pywikibot.page.BasePage) -> bool:
-        """Treat only non-redirect pages and handle IsRedirectPageError."""
-        if page.isRedirectPage():
-            _warning(f'Page {page} on {page.site} is skipped because it is'
-                     ' a redirect')
-            return True
-        return super().skip_page(page)
-
-
 class WikidataBot(Bot, ExistingPageBot):

     """Generic Wikidata Bot to be subclassed.

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1100143?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I550b8b068c241db39285460928a4380e0e02fb93
Gerrit-Change-Number: 1100143
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org

Reply via email to