From 10293b2cac3793b9ef163e593b480ad900cf2af9 Mon Sep 17 00:00:00 2001 From: xqt Date: Mon, 16 Oct 2023 10:14:28 +0200 Subject: [PATCH] [cleanup] drop unused use_hard_category_redirects - depreate BaseSite.use_hard_category_redirects - remove Family.use_hard_category_redirects Bug: T348953 Change-Id: Ifcbc0d8086c50d5c887f273f65f817af052a8621 --- pywikibot/family.py | 3 --- pywikibot/site/_basesite.py | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pywikibot/family.py b/pywikibot/family.py index 52c6d3a0ea..93cd1dff6d 100644 --- a/pywikibot/family.py +++ b/pywikibot/family.py @@ -118,9 +118,6 @@ def instance(cls): '_default': [] } - # A list of languages that use hard (not soft) category redirects - use_hard_category_redirects = [] - # A list of disambiguation template names in different languages disambiguationTemplates: Dict[str, Sequence[str]] = { '_default': [] diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index ea47b94f71..8175ebec61 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -25,6 +25,7 @@ ComparableMixin, SelfCallString, cached, + deprecated, first_upper, normalize_username, ) @@ -90,13 +91,23 @@ def __init__(self, code: str, fam=None, user=None) -> None: self._username = normalize_username(user) - self.use_hard_category_redirects = ( - self.code in self.family.use_hard_category_redirects) - # following are for use with lock_page and unlock_page methods self._pagemutex = threading.Condition() self._locked_pages = set() + @property + @deprecated(since='8.5.0') + def use_hard_category_redirects(self): + """Hard redirects are used for this site. + + Originally create as property for future use for a proposal to + replace category redirect templates with hard redirects. This + was never implemented and is not used inside the framework. + + .. deprecated:: 8.5 + """ + return False + @property @cached def throttle(self):