jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1101194?usp=email )
Change subject: cleanup: pywikibot.page cleanups ......................................................................
cleanup: pywikibot.page cleanups
- remove positional arguments of BasePage.linkedPages() - remove FilePage.usingPages() - update ROADMAP.rst
Bug: T378898 Change-Id: I8a32da5ba2d83c649905bed7c4c903401c97fb56 --- M ROADMAP.rst M pywikibot/page/_basepage.py M pywikibot/page/_filepage.py 3 files changed, 37 insertions(+), 52 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst index 1b9bebb..fb8c82a 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -3,9 +3,9 @@
**Improvements**
-* :attr:`.login.OauthLoginManager.access_token` was added -* Representation string for :class:`login.LoginManager` was added -* i18n updates +* :attr:`.login.OauthLoginManager.access_token` was added. +* Representation string for :class:`login.LoginManager` was added. +* i18n updates.
**Bugfixes**
@@ -13,32 +13,34 @@
**Code cleanups**
+* The positional arguments of :meth:`page.BasePage.linkedPages` were removed. +* ``FilePage.usingPages()`` was renamed to :meth:`using_pages()<pywikibot.FilePage.using_pages>`. * ``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 + :func:`textlib.to_latin_digits` can be used instead. * :mod:`textlib`.tzoneFixedOffset class was removed in favour of - :class:`time.TZoneFixedOffse<pywikibot.time.TZoneFixedOffset>` -* A boolean *watch* parameter in :meth:`page.BasePage.save` is desupported + :class:`time.TZoneFixedOffse<pywikibot.time.TZoneFixedOffset>`. +* A boolean *watch* parameter in :meth:`page.BasePage.save` is desupported. * ``XMLDumpOldPageGenerator`` was removed in favour of a ``content`` parameter of - :func:`pagegenerators.XMLDumpPageGenerator` (:phab:`T306134`) -* :meth:`pywikibot.User.is_blocked` method was renamed from ``isBlocked`` for consistency + :func:`pagegenerators.XMLDumpPageGenerator` (:phab:`T306134`). +* :meth:`pywikibot.User.is_blocked` method was renamed from ``isBlocked`` for consistency. * Values of :meth:`APISite.allpages()<pywikibot.site._generators.GeneratorsMixin.allpages>` - parameter filterredir must be True, False or None -* :mod:`tools.threading` classes no longer can be imported from :mod:`tools` -* :mod:`tools.itertools` datatypes no longer can be imported from :mod:`tools` -* :mod:`tools.collections` datatypes no longer can be imported from :mod:`tools` + parameter filterredir must be True, False or None. +* :mod:`tools.threading` classes no longer can be imported from :mod:`tools`. +* :mod:`tools.itertools` datatypes no longer can be imported from :mod:`tools`. +* :mod:`tools.collections` datatypes no longer can be imported from :mod:`tools`. * ``svn_rev_info`` and ``getversion_svn`` of :mod:`version` module were be removed. - SVN repository is no longer supported. (:phab:`T362484`) -* Old color escape sequences like ``\03{color}`` were dropped in favour of new color format like ``<<color>>`` -* ``tools.formatter.color_format()`` was removed; the new color literals can be used instead + SVN repository is no longer supported. (:phab:`T362484`). +* Old color escape sequences like ``\03{color}`` were dropped in favour of new color format like ``<<color>>``. +* ``tools.formatter.color_format()`` was removed; the new color literals can be used instead. * RedirectPageBot and NoRedirectPageBot bot classes were removed in favour of - :attr:`use_redirects<bot.BaseBot.use_redirects>` attribute + :attr:`use_redirects<bot.BaseBot.use_redirects>` attribute.
-** Other breaking changes** +**Other breaking changes**
* Python 3.7 support was dropped (:phab:`T378893`), including *importlib_metadata* of - :mod:`backports` + :mod:`backports`. * See also Current Deprecations below.
@@ -112,7 +114,6 @@ -------------------------------
* 9.4.0: :mod:`flow` support is deprecated and will be removed (:phab:`T371180`) -* 7.4.0: ``FilePage.usingPages()`` was renamed to :meth:`using_pages()<pywikibot.FilePage.using_pages>` * 7.3.0: ``linktrail`` method of :class:`family.Family` is deprecated; use :meth:`APISite.linktrail() <pywikibot.site._apisite.APISite.linktrail>` instead * 7.2.0: Positional arguments *decoder*, *layer* and *newline* for :mod:`logging` functions were dropped; keyword diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py index 9b907b6..8c9968c 100644 --- a/pywikibot/page/_basepage.py +++ b/pywikibot/page/_basepage.py @@ -42,7 +42,6 @@ deprecated, deprecated_args, first_upper, - issue_deprecation_warning, remove_last_args, )
@@ -1513,7 +1512,8 @@ apply_cosmetic_changes=False, nocreate=True, **kwargs)
def linkedPages( - self, *args, **kwargs + self, + **kwargs ) -> Generator[pywikibot.page.BasePage, None, None]: """Iterate Pages that this Page links to.
@@ -1525,36 +1525,29 @@ :py:mod:`APISite.pagelinks<pywikibot.site.APISite.pagelinks>`
.. versionadded:: 7.0 - the `follow_redirects` keyword argument + the `follow_redirects` keyword argument. .. deprecated:: 7.0 - the positional arguments + the positional arguments. + .. versionremoved:: 10.0 + the positional arguments.
- .. seealso:: :api:`Links` + .. seealso:: + - :meth:`Site.pagelinks + <pywikibot.site._generators.GeneratorsMixin.pagelinks>` + - :api:`Links`
:keyword namespaces: Only iterate pages in these namespaces (default: all) :type namespaces: iterable of str or Namespace key, or a single instance of those types. May be a '|' separated list of namespace identifiers. - :keyword follow_redirects: if True, yields the target of any redirects, - rather than the redirect page - :keyword total: iterate no more than this number of pages in total - :keyword content: if True, load the current content of each page + :keyword bool follow_redirects: if True, yields the target of + any redirects, rather than the redirect page + :keyword int total: iterate no more than this number of pages in + total + :keyword bool content: if True, load the current content of each + page """ - # Deprecate positional arguments and synchronize with Site.pagelinks - keys = ('namespaces', 'total', 'content') - for i, arg in enumerate(args): # pragma: no cover - key = keys[i] - issue_deprecation_warning( - f'Positional argument {i + 1} ({arg})', - f'keyword argument "{key}={arg}"', - since='7.0.0') - if key in kwargs: - pywikibot.warning(f'{key!r} is given as keyword argument ' - f'{arg!r} already; ignoring {kwargs[key]!r}') - else: - kwargs[key] = arg - return self.site.pagelinks(self, **kwargs)
def interwiki( diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py index bb4b054..6de3ecd 100644 --- a/pywikibot/page/_filepage.py +++ b/pywikibot/page/_filepage.py @@ -22,7 +22,7 @@ from pywikibot.comms import http from pywikibot.exceptions import NoPageError from pywikibot.page._page import Page -from pywikibot.tools import compute_file_hash, deprecated +from pywikibot.tools import compute_file_hash
__all__ = ( @@ -267,15 +267,6 @@ """ return self.site.imageusage(self, **kwargs)
- @deprecated('using_pages', since='7.4.0') - def usingPages(self, **kwargs): # noqa: N802 - """Yield Pages on which the file is displayed. - - .. deprecated:: 7.4 - Use :meth:`using_pages` instead. - """ - return self.using_pages(**kwargs) - @property def file_is_used(self) -> bool: """Check whether the file is used at this site.
pywikibot-commits@lists.wikimedia.org