jenkins-bot submitted this change.

View Change

Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
cleanup: remove APISite.article_path in favour of articlepath

Bug: T378898
Change-Id: Ida09f5d1346483d2f76bb00d76d589b4fcab7bf6
---
M ROADMAP.rst
M pywikibot/site/_apisite.py
2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/ROADMAP.rst b/ROADMAP.rst
index ff740a1..1b9bebb 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -13,6 +13,8 @@

**Code cleanups**

+* ``APISite.article_path`` was removed. :attr:`APISite.articlepath
+ <pywikibot.site._apisite.APISite.articlepath>` can be used instead.
* ``fix_digits`` method of :class:`textlib.TimeStripper` was removed;
:func:`textlib.to_latin_digits` can be used instead
* :mod:`textlib`.tzoneFixedOffset class was removed in favour of
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index ea1de97..f538551 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -823,25 +823,14 @@
and self._useroptions[f'searchNs{ns.id}']
in ['1', True]}

- @property # type: ignore[misc]
- @deprecated('articlepath', since='7.0.0')
- def article_path(self) -> str:
- """Get the nice article path without $1.
-
- .. deprecated:: 7.0
- Replaced by :py:meth:`articlepath`
- """
- return self.articlepath[:-2]
-
@property
def articlepath(self) -> str:
- """Get the nice article path with placeholder.
+ """Get the nice article path with ``{}``placeholder.

.. versionadded:: 7.0
- Replaces :py:meth:`article_path`
"""
- # Assert $1 placeholder is present
path = self.siteinfo['general']['articlepath']
+ # Assert $1 placeholder is present
assert '$1' in path, 'articlepath must contain "$1" placeholder'
return path.replace('$1', '{}')


To view, visit change 1101193. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ida09f5d1346483d2f76bb00d76d589b4fcab7bf6
Gerrit-Change-Number: 1101193
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot