Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221954?usp=email )
Change subject: tests: fix name of GraalPy tests
......................................................................
tests: fix name of GraalPy tests
Bug: T413596
Change-Id: Ibe7ba1170f8de942a3a5f883cb98d3088e51ae51
---
M .github/workflows/graalpy_tests.yml
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/.github/workflows/graalpy_tests.yml b/.github/workflows/graalpy_tests.yml
index c939def..d0688c2 100644
--- a/.github/workflows/graalpy_tests.yml
+++ b/.github/workflows/graalpy_tests.yml
@@ -1,6 +1,6 @@
---
-# Run Pywikibot tests with a variety of Python versions
-name: Pywikibot CI
+# Run GraalPy tests with a variety of GraalPy versions and os
+name: GraalPy Tests
on:
push:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221954?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: Ibe7ba1170f8de942a3a5f883cb98d3088e51ae51
Gerrit-Change-Number: 1221954
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-CC: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1217850?usp=email )
Change subject: Add partial block detection for User and Site
......................................................................
Add partial block detection for User and Site
This patch introduces is_partial_block() and get_block_info()
methods to the User class, and is_partial_block() to the APISite
class. This allows scripts to distinguish between sitewide blocks
and partial blocks.
Bug: T412613
Change-Id: I5e94357365c008f26bf9390ba5fdb697a1b2ff97
---
M README.rst
M pywikibot/page/_user.py
M pywikibot/site/_apisite.py
M tests/user_tests.py
4 files changed, 84 insertions(+), 0 deletions(-)
Approvals:
TheSandDoctor: Looks good to me, but someone else must approve
jenkins-bot: Verified
WASP-Outis: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
diff --git a/README.rst b/README.rst
index a2ac3c8..d251928 100644
--- a/README.rst
+++ b/README.rst
@@ -148,6 +148,17 @@
See https://github.com/wikimedia/pywikibot/blob/stable/HISTORY.rst
+Current Development
+===================
+
+The following features are available in the development version and will be
+included in the next release:
+
+* Add ``is_partial_blocked()`` method to ``User`` and ``APISite`` classes to detect partial blocks
+* Add ``get_block_info()`` method to ``User`` class to retrieve detailed block information including block ID, reason, expiry, and restrictions
+
+See `T412613 <https://phabricator.wikimedia.org/T412613>`_ for details.
+
Contributing
============
diff --git a/pywikibot/page/_user.py b/pywikibot/page/_user.py
index 9d4ea52..7753850 100644
--- a/pywikibot/page/_user.py
+++ b/pywikibot/page/_user.py
@@ -159,6 +159,32 @@
"""
return 'blockedby' in self.getprops(force)
+ def is_partial_blocked(self, force: bool = False) -> bool:
+ """Return True if this user is partially blocked, False otherwise.
+
+ .. versionadded:: 11.0
+ """
+ return 'blockpartial' in self.getprops(force)
+
+ def get_block_info(self, force: bool = False) -> dict[str, Any] | None:
+ """Return a dictionary of block information if the user is blocked.
+
+ Returns None if the user is not blocked.
+ The returned dictionary contains keys like:
+ - blockid
+ - blockedby
+ - blockreason
+ - blockexpiry
+ - blockpartial (only if partial block)
+
+ .. versionadded:: 11.0
+ """
+ props = self.getprops(force)
+ if 'blockid' not in props:
+ return None
+
+ return {k: v for k, v in props.items() if k.startswith('block')}
+
def is_locked(self, force: bool = False) -> bool:
"""Determine whether the user is currently locked globally.
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 8664488..91837f5 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -779,6 +779,15 @@
del self.userinfo
return 'blockinfo' in self.userinfo
+ def is_partial_blocked(self, force: bool = False) -> bool:
+ """Return True if the logged-in user is partially blocked.
+
+ .. versionadded:: 11.0
+ """
+ if force:
+ del self.userinfo
+ return 'partial' in self.userinfo.get('blockinfo', {})
+
def is_locked(self,
user: str | int | None = None,
force: bool = False) -> bool:
diff --git a/tests/user_tests.py b/tests/user_tests.py
index 651734a..8099e30 100755
--- a/tests/user_tests.py
+++ b/tests/user_tests.py
@@ -168,6 +168,44 @@
user = User(self.site, 'TonjaHeritage2')
self.assertTrue(user.is_locked())
+ def test_block_info(self) -> None:
+ """Test block information methods."""
+ # 1. Test partial block detection
+ user = User(self.site, 'PartialUser')
+ user._userprops = {
+ 'userid': 1234,
+ 'blockid': 12345,
+ 'blockpartial': '',
+ 'blockreason': 'Test partial'
+ }
+
+ self.assertTrue(user.is_partial_blocked())
+ info = user.get_block_info()
+ self.assertIsNotNone(info)
+ self.assertIn('blockpartial', info)
+ self.assertEqual(info['blockid'], 12345)
+
+ # 2. Test full block (not partial)
+ user = User(self.site, 'FullUser')
+ user._userprops = {
+ 'userid': 5678,
+ 'blockid': 67890,
+ 'blockreason': 'Test full'
+ }
+
+ self.assertFalse(user.is_partial_blocked())
+ info = user.get_block_info()
+ self.assertIsNotNone(info)
+ self.assertNotIn('blockpartial', info)
+ self.assertEqual(info['blockid'], 67890)
+
+ # 3. Test unblocked user
+ user = User(self.site, 'NormalUser')
+ user._userprops = {'userid': 999}
+
+ self.assertFalse(user.is_partial_blocked())
+ self.assertIsNone(user.get_block_info())
+
class TestUserMethods(DefaultSiteTestCase):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1217850?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: I5e94357365c008f26bf9390ba5fdb697a1b2ff97
Gerrit-Change-Number: 1217850
Gerrit-PatchSet: 4
Gerrit-Owner: WASP-Outis <Sh.darkone(a)protonmail.ch>
Gerrit-Reviewer: TheSandDoctor <majorjohn1(a)mail.com>
Gerrit-Reviewer: WASP-Outis <Sh.darkone(a)protonmail.ch>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221614?usp=email )
Change subject: Revert^3 "doc: replace directives describing changes between versions"
......................................................................
Revert^3 "doc: replace directives describing changes between versions"
This reverts commit c25e4088f0433ce3b7193a9dfda6fb01fcdb6971.
Reason for revert: T413563 is not solved upstream yet
Bug: T413563
Change-Id: If3fe53fb1240abb2668ba84c4085f47ea2a6e152
---
M conftest.py
M docs/api_ref/family.rst
M docs/api_ref/pywikibot.site.rst
M docs/api_ref/tools/tools.itertools.rst
M docs/api_ref/tools/tools.threading.rst
M docs/conf.py
M docs/introduction.rst
M docs/requirements.txt
M docs/scripts/archive.rst
M make_dist.py
M pwb.py
M pywikibot/__init__.py
M pywikibot/__metadata__.py
M pywikibot/_wbtypes.py
M pywikibot/backports.py
M pywikibot/bot.py
M pywikibot/bot_choice.py
M pywikibot/comms/eventstreams.py
M pywikibot/comms/http.py
M pywikibot/config.py
M pywikibot/cosmetic_changes.py
M pywikibot/daemonize.py
M pywikibot/data/__init__.py
M pywikibot/data/api/_generators.py
M pywikibot/data/api/_optionset.py
M pywikibot/data/api/_paraminfo.py
M pywikibot/data/api/_requests.py
M pywikibot/data/citoid.py
M pywikibot/data/memento.py
M pywikibot/data/sparql.py
M pywikibot/data/superset.py
M pywikibot/data/wikistats.py
M pywikibot/date.py
M pywikibot/diff.py
M pywikibot/echo.py
M pywikibot/editor.py
M pywikibot/exceptions.py
M pywikibot/families/commons_family.py
M pywikibot/families/foundation_family.py
M pywikibot/families/lingualibre_family.py
M pywikibot/families/wikifunctions_family.py
M pywikibot/families/wikihow_family.py
M pywikibot/families/wikimania_family.py
M pywikibot/families/wikipedia_family.py
M pywikibot/families/wikispore_family.py
M pywikibot/families/wiktionary_family.py
M pywikibot/families/wowwiki_family.py
M pywikibot/family.py
M pywikibot/fixes.py
M pywikibot/i18n.py
M pywikibot/logentries.py
M pywikibot/logging.py
M pywikibot/login.py
M pywikibot/page/_basepage.py
M pywikibot/page/_category.py
M pywikibot/page/_collections.py
M pywikibot/page/_filepage.py
M pywikibot/page/_links.py
M pywikibot/page/_page.py
M pywikibot/page/_toolforge.py
M pywikibot/page/_user.py
M pywikibot/page/_wikibase.py
M pywikibot/pagegenerators/__init__.py
M pywikibot/pagegenerators/_factory.py
M pywikibot/pagegenerators/_generators.py
M pywikibot/plural.py
M pywikibot/proofreadpage.py
M pywikibot/scripts/__init__.py
M pywikibot/scripts/generate_family_file.py
M pywikibot/scripts/generate_user_files.py
M pywikibot/scripts/login.py
M pywikibot/scripts/shell.py
M pywikibot/scripts/version.py
M pywikibot/scripts/wrapper.py
M pywikibot/site/_apisite.py
M pywikibot/site/_basesite.py
M pywikibot/site/_datasite.py
M pywikibot/site/_extensions.py
M pywikibot/site/_generators.py
M pywikibot/site/_namespace.py
M pywikibot/site/_siteinfo.py
M pywikibot/site/_tokenwallet.py
M pywikibot/site/_upload.py
M pywikibot/site_detect.py
M pywikibot/specialbots/_upload.py
M pywikibot/textlib.py
M pywikibot/throttle.py
M pywikibot/time.py
M pywikibot/titletranslate.py
M pywikibot/tools/__init__.py
M pywikibot/tools/_deprecate.py
M pywikibot/tools/chars.py
M pywikibot/tools/collections.py
M pywikibot/tools/formatter.py
M pywikibot/tools/itertools.py
M pywikibot/tools/threading.py
M pywikibot/userinterfaces/_interface_base.py
M pywikibot/userinterfaces/buffer_interface.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/transliteration.py
M pywikibot/version.py
M pywikibot/xmlreader.py
M scripts/archivebot.py
M scripts/blockpageschecker.py
M scripts/category.py
M scripts/category_graph.py
M scripts/category_redirect.py
M scripts/change_pagelang.py
M scripts/checkimages.py
M scripts/commons_information.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/delinker.py
M scripts/djvutext.py
M scripts/download_dump.py
M scripts/harvest_template.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/maintenance/__init__.py
M scripts/maintenance/addwikis.py
M scripts/maintenance/cache.py
M scripts/maintenance/unidata.py
M scripts/movepages.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/protect.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/revertbot.py
M scripts/touch.py
M scripts/tracking_param_remover.py
M scripts/transwikiimport.py
M scripts/unlink.py
M scripts/unusedfiles.py
M scripts/watchlist.py
M scripts/welcome.py
M setup.py
M tests/README.rst
M tests/aspects.py
M tests/basepage.py
M tests/gui_tests.py
M tests/hooks/__init__.py
M tests/hooks/copyright_fixer.py
M tests/pwb/print_argv.py
M tests/superset_tests.py
M tests/utils.py
149 files changed, 892 insertions(+), 893 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/conftest.py b/conftest.py
index 4b7a46b..544f800 100644
--- a/conftest.py
+++ b/conftest.py
@@ -1,6 +1,6 @@
"""Configuration file for pytest.
-.. version-added:: 10.3
+.. versionadded:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/docs/api_ref/family.rst b/docs/api_ref/family.rst
index be07648..314d96a 100644
--- a/docs/api_ref/family.rst
+++ b/docs/api_ref/family.rst
@@ -37,4 +37,4 @@
aliases['yue'] = 'zh-yue'
cls.code_aliases = aliases
- .. version-added:: 8.3
+ .. versionadded:: 8.3
diff --git a/docs/api_ref/pywikibot.site.rst b/docs/api_ref/pywikibot.site.rst
index 82029bd..6fe32e4 100644
--- a/docs/api_ref/pywikibot.site.rst
+++ b/docs/api_ref/pywikibot.site.rst
@@ -32,7 +32,7 @@
Return tuple of edit restricted templates.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
.. seealso:: :meth:`family.Family.get_edit_restricted_templates`
:rtype: tuple[str, ...]
@@ -42,7 +42,7 @@
Return tuple of edit restricted templates.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
.. seealso:: :meth:`family.Family.get_archived_page_templates`
:rtype: tuple[str, ...]
@@ -65,7 +65,7 @@
May be overridden to return 'http'. Other protocols are not
supported.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
``https`` is returned instead of ``http``.
.. seealso:: :meth:`family.Family.protocol`
@@ -107,11 +107,11 @@
Using *namespace* option different from ``0``
needs a lot of time on Wikidata site.
- .. version-deprecated:: 10.7
+ .. deprecated:: 10.7
This method is dysfunctional and should no longer be used. It
will be removed in Pywikibot 11.
- .. version-removed:: 11.0
+ .. versionremoved:: 11.0
This method was dysfunctional and removed, see the following tickets for details:
:phab:`T359427`, :phab:`T364617` and :phab:`T407708`
diff --git a/docs/api_ref/tools/tools.itertools.rst b/docs/api_ref/tools/tools.itertools.rst
index 64bc794..9aa7746 100644
--- a/docs/api_ref/tools/tools.itertools.rst
+++ b/docs/api_ref/tools/tools.itertools.rst
@@ -10,9 +10,9 @@
Make an iterator that returns lists of (up to) *size* items from *iterable*.
- .. version-added:: 7.6
+ .. versionadded:: 7.6
The *strict* parameter.
- .. version-deprecated:: 8.2
+ .. deprecated:: 8.2
Use :func:`backports.batched` instead.
- .. version-removed:: 11.0
+ .. versionremoved:: 11.0
This function was removed; use :pylib:`itertools.batched<itertools#itertools.batched>` instead.
diff --git a/docs/api_ref/tools/tools.threading.rst b/docs/api_ref/tools/tools.threading.rst
index 5e8bd77..c1ef728 100644
--- a/docs/api_ref/tools/tools.threading.rst
+++ b/docs/api_ref/tools/tools.threading.rst
@@ -6,5 +6,5 @@
.. autoclass:: RLock
- .. version-deprecated:: 10.2
+ .. deprecated:: 10.2
use :mod:`backports.RLock` instead
diff --git a/docs/conf.py b/docs/conf.py
index aa8d2f7..1f695ea 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -46,7 +46,7 @@
# If your documentation needs a minimal Sphinx version, state it here.
#
-needs_sphinx = '9.0.4'
+needs_sphinx = '8.2.3'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -468,7 +468,6 @@
show_authors = True
todo_include_todos = True
autodoc_typehints = 'description'
-autodoc_use_legacy_class_based = True # T413563
# autosectionlabel_prefix_document = True
suppress_warnings = ['autosectionlabel.*']
@@ -515,7 +514,7 @@
def pywikibot_docstring_fixups(app, what, name, obj, options, lines) -> None:
"""Remove plain 'Initializer.' or 'Allocator.' docstring.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
remove 'Allocator.' docstring too.
"""
if what not in ('class', 'exception'):
diff --git a/docs/introduction.rst b/docs/introduction.rst
index de11f04..70bf537 100644
--- a/docs/introduction.rst
+++ b/docs/introduction.rst
@@ -35,7 +35,7 @@
#. fallback is `'en'` for English if all other options fails
.. note:: The preferred language code must follow ISO 639.
-.. version-added:: 7.0
+.. versionadded:: 7.0
Added to site-package distribution
.. seealso::
* :manpage:`i18n` Manual
diff --git a/docs/requirements.txt b/docs/requirements.txt
index ea3fcc2..000b218 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,7 +1,7 @@
# This is a PIP requirements file for building Sphinx documentation of Pywikibot
# ../requirements.txt is also needed.
# Note: Python 3.11 is required for sphinx 8.2+
-sphinx >= 9.0.4
+sphinx == 8.2.3
rstcheck >=6.2.5
sphinxext-opengraph >= 0.13.0
sphinx-copybutton >= 0.5.2
diff --git a/docs/scripts/archive.rst b/docs/scripts/archive.rst
index 4481c24..9877db6 100644
--- a/docs/scripts/archive.rst
+++ b/docs/scripts/archive.rst
@@ -70,7 +70,7 @@
amend the related Wikidata item for edition (with the
:samp:`P212, {ISBN number}` as unique external ID).
-.. version-removed:: 11.0
+.. versionremoved:: 11.0
An external version of this script can be found in the
`geertivp/Pywikibot <https://github.com/geertivp/Pywikibot>`_ script
collection. See :phab:`T398140` for details.
@@ -118,8 +118,8 @@
cases where a more precise and less precise value have both been
included.
-.. version-added:: 7.2
-.. version-removed:: 10.0
+.. versionadded:: 7.2
+.. versionremoved:: 10.0
disambredirs script
===================
diff --git a/make_dist.py b/make_dist.py
index c910cea..238928a 100755
--- a/make_dist.py
+++ b/make_dist.py
@@ -27,28 +27,28 @@
[pwb] make_dist [repo] [options]
-.. version-added:: 7.3
-.. version-changed:: 7.4
+.. versionadded:: 7.3
+.. versionchanged:: 7.4
- updates pip, setuptools, wheel and twine packages first
- installs pre-releases over stable versions
- also creates built distribution together with source distribution
- *-upgrade* option was added
-.. version-changed:: 7.5
+.. versionchanged:: 7.5
- *clear* option was added
- *nodist* option was added
-.. version-changed:: 8.1
+.. versionchanged:: 8.1
*nodist* option was removed, *clear* option does not create a
distribution. *local* and *remote* option clears old distributions
first.
-.. version-changed:: 8.2
+.. versionchanged:: 8.2
Build frontend was changed from setuptools to build. ``-upgrade``
option also installs packages if necessary.
-.. version-changed:: 9.4
+.. versionchanged:: 9.4
The pywikibot-scripts distribution can be created.
"""
#
@@ -75,8 +75,8 @@
"""Setup distribution base class.
- .. version-added:: 8.0
- .. version-changed:: 8.1
+ .. versionadded:: 8.0
+ .. versionchanged:: 8.1
*dataclass* is used.
"""
@@ -95,7 +95,7 @@
def clear_old_dist(self) -> None: # pragma: no cover
"""Delete old dist folders.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
info('<<lightyellow>>Removing old dist folders... ', newline=False)
shutil.rmtree(self.folder / 'build', ignore_errors=True)
@@ -146,7 +146,7 @@
def build(self) -> bool: # pragma: no cover
"""Build the packages.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
"""
self.copy_files()
info('<<lightyellow>>Build package')
@@ -178,7 +178,7 @@
"""Setup for Pywikibot distribution.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
build_opt = '' # defaults to current directory
@@ -221,7 +221,7 @@
"""Setup pywikibot-scripts distribution.
- .. version-added:: 9.4
+ .. versionadded:: 9.4
"""
build_opt = '-w' # only wheel (yet)
diff --git a/pwb.py b/pwb.py
index b00bf9b..e8c5ed6 100755
--- a/pwb.py
+++ b/pwb.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""PWB caller script to invoke the :mod:`pywikibot.scripts.wrapper` script.
-.. version-added:: 8.0
+.. versionadded:: 8.0
"""
#
# (C) Pywikibot team, 2022-2025
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 2348823..7dc246a 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -170,16 +170,16 @@
.. warning:: Never create a site object via interface class directly.
Always use this factory method.
- .. version-changed:: 5.6
+ .. versionchanged:: 5.6
If a family file does not fit the given *url*, an
:class:`family.AutoFamily` is used to create the site.
- .. version-changed:: 7.3
+ .. versionchanged:: 7.3
Short creation if site code is equal to family name like
`Site('commons')`, `Site('meta')` or `Site('wikidata')`.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*url* does not have to contain an api, requests or script path
any longer.
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
accept a trailing slash in *url* after domain.
:param code: language code (override config.mylang)
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index bfcef6c..06533c8 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -1,6 +1,6 @@
"""Pywikibot metadata file.
-.. version-added:: 4.0
+.. versionadded:: 4.0
"""
#
# (C) Pywikibot team, 2020-2025
@@ -12,6 +12,6 @@
from time import strftime
-__version__ = '11.0.0.dev7'
+__version__ = '11.0.0.dev8'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
__copyright__ = f'2003-{strftime("%Y")}, Pywikibot team'
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index bcfced3..6b6a189 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -79,7 +79,7 @@
def __repr__(self) -> str:
"""String representation of this object.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Parameters are shown as representations instead of plain
strings.
@@ -126,7 +126,7 @@
) -> None:
"""Represent a geo coordinate.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
The parameters after `lat` and `lon` are now keyword-only.
:param lat: Latitude coordinate
@@ -332,7 +332,7 @@
A successful lookup is stored as an internal value to avoid the
need for repeated lookups.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
The *lazy_load* parameter is now keyword-only.
:param repo: the Wikibase site for the globe, if different from
@@ -472,11 +472,11 @@
the equality operator will return false if the timezone is
different.
- .. version-deprecated:: 10.0
+ .. deprecated:: 10.0
*precision* value 'millenia' is deprecated; 'millennium' must
be used instead.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
The parameters except timestamp values are now keyword-only.
A TypeError is raised if *year* is not an int. Previously, a
ValueError was raised if *year* was None.
@@ -561,7 +561,7 @@
This value should *only* be used for comparisons, and its value
may change without warning.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
:return: An integer roughly representing the number of seconds
since January 1, 0000 AD, adjusted for leap years.
@@ -597,7 +597,7 @@
def __lt__(self, other: object) -> bool:
"""Compare if self is less than other.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() < other._getSecondsAdjusted()
@@ -606,7 +606,7 @@
def __le__(self, other: object) -> bool:
"""Compare if self is less equals other.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() <= other._getSecondsAdjusted()
@@ -615,7 +615,7 @@
def __gt__(self, other: object) -> bool:
"""Compare if self is greater than other.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() > other._getSecondsAdjusted()
@@ -624,7 +624,7 @@
def __ge__(self, other: object) -> bool:
"""Compare if self is greater equals other.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() >= other._getSecondsAdjusted()
@@ -641,7 +641,7 @@
with == with a time at 15:00 UTC, but would return true with
this method.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
return self._getSecondsAdjusted() == other._getSecondsAdjusted()
@@ -669,7 +669,7 @@
- Time is always in UTC and ends with ``Z``.
- Example: ``+0000000000123456-01-01T00:00:00Z``.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
The parameters except *datetimestr* are now keyword-only.
:param datetimestr: Timestamp string to parse
@@ -713,9 +713,9 @@
) -> WbTime:
"""Create a new WbTime object from a pywikibot.Timestamp.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Added *copy_timezone* parameter.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
The parameters except *timestamp* are now keyword-only.
@@ -749,7 +749,7 @@
The rounding is performed towards positive infinity for positive
years and towards negative infinity for negative years.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param year: The year as an integer.
:return: The first year of the millennium containing the given
@@ -772,7 +772,7 @@
The rounding is performed towards positive infinity for positive
years and towards negative infinity for negative years.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param year: The year as an integer.
:return: The first year of the century containing the given year.
@@ -793,7 +793,7 @@
Unlike millennium or century normalization, this always
truncates towards zero.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param year: The year as an integer.
:return: The first year of the decade containing the given year.
@@ -811,7 +811,7 @@
This is used for very coarse historical precision levels, where
the time unit represents a power-of-ten number of years.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param year: The year as an integer.
:param precision: The precision level (Wikibase int value).
@@ -879,9 +879,9 @@
.. seealso:: :meth:`fromTimestr` for differences between output
with and without *force_iso* parameter.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*normalize* parameter was added.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*normalize* parameter was removed due to :phab:`T340495` and
:phab:`T57755`
@@ -898,7 +898,7 @@
def toTimestamp(self, timezone_aware: bool = False) -> Timestamp:
"""Convert the data to a pywikibot.Timestamp.
- .. version-changed:: 8.0.1
+ .. versionchanged:: 8.0.1
*timezone_aware* parameter was added.
:param timezone_aware: Whether the timezone should be passed to
@@ -918,9 +918,9 @@
def toWikibase(self) -> dict[str, Any]:
"""Convert the data to a JSON object for the Wikibase API.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*normalize* parameter was added.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*normalize* parameter was removed due to :phab:`T340495` and
:phab:`T57755`
@@ -1304,8 +1304,8 @@
This data type is just a json container
- .. version-added:: 3.0
- .. version-changed:: 9.4
+ .. versionadded:: 3.0
+ .. versionchanged:: 9.4
*warning* parameter was added
"""
@@ -1324,7 +1324,7 @@
def toWikibase(self) -> dict[str, Any]:
"""Return the JSON object for the Wikibase API.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
a waning message given by the warning attribute is shown once.
:return: Wikibase JSON
diff --git a/pywikibot/backports.py b/pywikibot/backports.py
index e3e40c1..5936ab7 100644
--- a/pywikibot/backports.py
+++ b/pywikibot/backports.py
@@ -4,7 +4,7 @@
Breaking changes may be made at any time, and the module is not
subject to deprecation requirements.
-.. version-changed:: 10.0
+.. versionchanged:: 10.0
This module is 'private'.
"""
#
@@ -36,7 +36,7 @@
.. seealso:: :python:`itertools.pairwise
<library/itertools.html#itertools.pairwise>`,
backported from Python 3.10.
- .. version-added:: 7.6
+ .. versionadded:: 7.6
"""
a, b = tee(iterable)
next(b, None)
@@ -81,8 +81,8 @@
.. seealso:: :python:`itertools.batched
<library/itertools.html#itertools.batched>`,
backported from Python 3.12.
- .. version-added:: 8.2
- .. version-changed:: 9.0
+ .. versionadded:: 8.2
+ .. versionchanged:: 9.0
Added *strict* option, backported from Python 3.13
:param n: How many items of the iterable to get in one chunk
@@ -148,8 +148,8 @@
>>> lock.locked()
False
- .. version-added:: 6.2
- .. version-changed:: 10.2
+ .. versionadded:: 6.2
+ .. versionchanged:: 10.2
moved from :mod:`tools.threading` to :mod:`backports`.
.. note:: Passing any arguments has no effect and has been
deprecated since Python 3.14 and was removed in Python 3.15.
@@ -187,7 +187,7 @@
def count(self):
"""Return number of acquired locks.
- .. version-deprecated:: 10.2
+ .. deprecated:: 10.2
"""
with self._block:
counter = re.search(r'count=(\d+) ', repr(self))
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 5286743..4a435ea 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -55,7 +55,7 @@
subclasses :class:`CurrentPageBot` and automatically defines the summary
when :meth:`put_current` is used.
-.. version-deprecated:: 9.2
+.. deprecated:: 9.2
The functions
:func:`critical()<pywikibot.logging.critical>`
:func:`debug()<pywikibot.logging.debug>`
@@ -74,7 +74,7 @@
within this module. Import them directly. These functions can also be
used as :mod:`pywikibot` members.
-.. version-removed:: 10.0
+.. versionremoved:: 10.0
The bot classes :class:`RedirectPageBot` and
:class:`NoRedirectPageBot` are deprecated. Use
:attr:`use_redirects<BaseBot.use_redirects>` attribute instead.
@@ -291,7 +291,7 @@
Calls :func:`init_handlers` to re-initialize if we were already
initialized with another UI.
- .. version-added:: 6.4
+ .. versionadded:: 6.4
"""
global ui
@@ -322,7 +322,7 @@
>>> handler_namer('add_text.log.1')
'add_text.1.log'
- .. version-added:: 6.5
+ .. versionadded:: 6.5
"""
path, qualifier = name.rsplit('.', 1)
root, ext = os.path.splitext(path)
@@ -369,7 +369,7 @@
use :func:`pywikibot.info()<pywikibot.logging.info>` function and
other functions from :mod:`pywikibot.logging` module.
- .. version-changed:: 6.2
+ .. versionchanged:: 6.2
Different logfiles are used if multiple processes of the same
script are running.
"""
@@ -468,7 +468,7 @@
This may help the user to track errors or report bugs.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
ignore milliseconds with timestamp.
"""
_log(f'\n=== Pywikibot framework v{pywikibot.__version__} --'
@@ -541,7 +541,7 @@
def initialize_handlers(function):
"""Make sure logging system has been initialized.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
@wraps(function)
def wrapper(*args, **kwargs):
@@ -670,7 +670,7 @@
docstring and because the module name will be used for the filename
of the log.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
Detect unittest and pytest run and return the test module.
"""
mod = pywikibot.argvu[0]
@@ -724,17 +724,17 @@
be used even if the `handle_args` method is used within the
script.
- .. version-changed:: 5.2
+ .. versionchanged:: 5.2
*-site* global option was added
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
*-cosmetic_changes* and *-cc* may be set directly instead of
toggling the value. Refer :func:`tools.strtobool` for valid values.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
*-config* global option was added.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Short site value can be given if site code is equal to family
like ``-site:meta``.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
``-nolog`` option also discards command.log.
:param args: Command line arguments. If None,
@@ -879,9 +879,9 @@
show_global: bool = False) -> None:
"""Show help for the Bot.
- .. version-changed:: 4.0
+ .. versionchanged:: 4.0
Renamed from showHelp() to show_help().
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Do not show version changes.
"""
if not module_name:
@@ -987,7 +987,7 @@
def open_webbrowser(page: pywikibot.page.BasePage) -> None:
"""Open the web browser displaying the page and wait for input.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
No longer follow a redirect.
"""
webbrowser.open(f'{page.full_url()}?redirect=no')
@@ -998,7 +998,7 @@
"""The option dict which holds the options of OptionHandler.
- .. version-added:: 4.1
+ .. versionadded:: 4.1
"""
def __init__(self, classname: str, options: dict[str, Any]) -> None:
@@ -1118,7 +1118,7 @@
For bot options handling refer :class:`OptionHandler` class above.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
A :attr:`counter` instance variable is provided.
"""
@@ -1127,7 +1127,7 @@
True to use disambigs only, set it to False to skip disambigs. If None both
are processed.
- .. version-added:: 7.2
+ .. versionadded:: 7.2
"""
use_redirects: bool | None = None
@@ -1144,7 +1144,7 @@
use_redirects = True
- .. version-added:: 7.2
+ .. versionadded:: 7.2
"""
available_options = {
@@ -1156,7 +1156,7 @@
use it if the bot class is to be derived but use
`self.available_options.update(<dict>)` initializer in such case.
- .. version-added:: 6.4
+ .. versionadded:: 6.4
"""
_current_page: pywikibot.page.BasePage | None = None
@@ -1185,8 +1185,8 @@
self.counter['delete'] += 1
- .. version-added:: 7.0
- .. version-changed:: 7.3
+ .. versionadded:: 7.0
+ .. versionchanged:: 7.3
Your additional counters are also printed during :meth:`exit`
"""
@@ -1205,15 +1205,15 @@
print('generator was emtpty')
.. note:: An empty generator returns True.
- .. version-added:: 3.0
- .. version-changed:: 7.4
+ .. versionadded:: 3.0
+ .. versionchanged:: 7.4
renamed to `generator_completed` to become a public attribute.
"""
self.treat_page_type: Any = pywikibot.page.BasePage
"""Instance variable to hold the default page type used by :meth:`run`.
- .. version-added:: 6.1
+ .. versionadded:: 6.1
"""
@property
@@ -1373,9 +1373,9 @@
.. note:: Do not overwrite it by subclasses; :meth:`teardown`
should be used instead.
- .. version-changed:: 7.3
+ .. versionchanged:: 7.3
Statistics are printed for all entries in :attr:`counter`
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Print execution time with days, hours, minutes and seconds.
"""
self.teardown()
@@ -1438,9 +1438,9 @@
def skip_page(self, page: pywikibot.page.BasePage) -> bool:
"""Return whether treat should be skipped for the page.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
use :attr:`use_redirects` to handle redirects,
use :attr:`use_disambigs` to handle disambigs
@@ -1482,13 +1482,13 @@
Invoked by :meth:`run` before running through :attr:`generator`
loop.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def teardown(self) -> None:
"""Some cleanups after :meth:`run` operation. Invoked by :meth:`exit`.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def run(self) -> None:
@@ -1534,16 +1534,16 @@
finally:
self.exit()
- .. version-changed:: 3.0
+ .. versionchanged:: 3.0
``skip`` counter was added.; call :meth:`setup` first.
- .. version-changed:: 6.0
+ .. versionchanged:: 6.0
upcast :attr:`generator` to a ``Generator`` type to enable
``generator.close()`` method.
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
Objects from :attr:`generator` may be different from
:class:`pywikibot.Page` but the type must be registered in
:attr:`treat_page_type`.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
leave method gracefully if :attr:`generator` is None using
:func:`suggest_help` function.
@@ -1759,7 +1759,7 @@
The bot should accommodate for that case and not store site specific
information on only one site.
- .. version-changed:: 6.2
+ .. versionchanged:: 6.2
Site attribute has been dropped.
"""
@@ -1786,7 +1786,7 @@
2. `script.ini options` settings
3. command line arguments
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
INI = 'scripts.ini'
@@ -1916,7 +1916,7 @@
For parameters see :meth:`CurrentPageBot.put_current`
- .. version-changed:: 10.6
+ .. versionchanged:: 10.6
return whether the page was saved successfully
"""
if not kwargs.get('summary'):
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index 0a3c7aa..eaa78f0 100644
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -115,7 +115,7 @@
def result(self, value: str) -> Any:
"""Return the actual value which is associated by the given one.
- .. version-added:: 6.2
+ .. versionadded:: 6.2
*result()* is an abstract method and must be defined in
subclasses
"""
@@ -156,7 +156,7 @@
<userinterfaces._interface_base.ABUIC.input_choice>`
instead of deprecated :meth:`output`.
- .. version-added:: 6.2
+ .. versionadded:: 6.2
"""
return ''
@@ -508,7 +508,7 @@
"""An option to show a list and select an item.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
before_question = True
@@ -548,7 +548,7 @@
"""An option to select multiple items from a list.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def test(self, value: str) -> bool:
@@ -579,7 +579,7 @@
"""An option to show a list and select multiple items.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 651a3c7..8ab71b6 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -6,8 +6,8 @@
pip install "requests-sse>=0.5.0"
-.. version-added:: 3.0
-.. version-changed:: 10.0
+.. versionadded:: 3.0
+.. versionchanged:: 10.0
``requests-sse`` package is required instead of ``sseclient``.
"""
#
@@ -110,9 +110,9 @@
'wiki': 'wikidatawiki'}
>>> del stream
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*retry* value is doubled for each consecutive connect try.
"""
@@ -129,7 +129,7 @@
by including a 'retry' line in a message. Retries are handled
automatically.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
5 seconds are used instead of 3 seconds as default.
:keyword pywikibot.Timestamp | str since: a timestamp for older
@@ -162,7 +162,7 @@
:keyword int chunk_size: [*requests*] A maximum size of the chunk
for chunk-encoded requests.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
None is used instead of 1024 as default value.
:param kwargs: Other keyword arguments passed to `requests_sse`
@@ -373,7 +373,7 @@
def generator(self):
"""Inner generator.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
changed from iterator method to generator property
"""
n = 0
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 7ed7ccd..281cf16 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -21,7 +21,7 @@
session.cookies = http.cookie_jar
-.. version-changed:: 8.0
+.. versionchanged:: 8.0
Cookies are lazy loaded when logging to site.
"""
#
@@ -67,8 +67,8 @@
"""CookieJar which create the filename and checks file permissions.
- .. version-added:: 8.0
- .. version-changed:: 10.2
+ .. versionadded:: 8.0
+ .. versionchanged:: 10.2
use `threading.Lock` in :meth:`load` and :meth`save` to be thread
safe.
"""
@@ -119,7 +119,7 @@
def flush() -> None: # pragma: no cover
"""Close the session object. This is called when the module terminates.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
log the traceback and show the exception value in the critical
message
"""
@@ -264,7 +264,7 @@
The optional uri is a relative uri from site base uri including the
document root '/'.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
a *protocol* parameter can be given which is passed to the
:meth:`family.Family.base_url` method.
@@ -472,7 +472,7 @@
def get_charset_from_content_type(content_type: str) -> str | None:
"""Get charset from the content-type header.
- .. version-added:: 7.3
+ .. versionadded:: 7.3
"""
m = CHARSET_RE.search(content_type)
if not m:
@@ -522,7 +522,7 @@
charset: str | None = None) -> str | None:
"""Detect the response encoding.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
retrieve charset from `Accept-Charset` list which may look like
`'ISO-8859-1,utf-8;q=0.7,*;q=0.7'`.
diff --git a/pywikibot/config.py b/pywikibot/config.py
index 74bc950..191d637 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -26,9 +26,9 @@
- datafilepath
- shortpath
-.. version-changed:: 6.2
+.. versionchanged:: 6.2
config2 was renamed to config
-.. version-changed:: 8.0
+.. versionchanged:: 8.0
Editor settings has been revised. *editor* variable is None by
default. Editor detection functions were moved to :mod:`editor`.
"""
@@ -281,7 +281,7 @@
def get_user_config_file() -> str:
"""Return user config file name.
- .. version-added:: 7.7
+ .. versionadded:: 7.7
"""
for arg in sys.argv[1:]:
opt, _, value = arg.partition(':')
@@ -313,7 +313,7 @@
Set `PYWIKIBOT_NO_USER_CONFIG=1` to disable loading user config file
(`user-config.py`) or install Pywikibot as a site-package.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
Added the *config_file* parameter.
:param test_directory: Assume that a user config file exists in this
@@ -415,7 +415,7 @@
not_exists_ok: bool = False) -> None:
"""Register all family class files contained in a directory.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
The *not_exists_ok* parameter
:param folder_path: The path of a folder containing family files.
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 95e3d73..eb67d07 100644
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -179,7 +179,7 @@
order. This dict is used in
:meth:`CosmeticChangesToolkit.standardizePageFooter`.
-.. version-added:: 9.3
+.. versionadded:: 9.3
"""
@@ -190,7 +190,7 @@
If an error occurred and either skips the page or the method
or a single match. ALL raises the exception.
- .. version-added:: 6.3
+ .. versionadded:: 6.3
"""
ALL = 0
@@ -230,7 +230,7 @@
"""Cosmetic changes toolkit.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
`from_page()` method was removed
"""
@@ -239,12 +239,12 @@
ignore: IntEnum = CANCEL.ALL) -> None:
"""Initializer.
- .. version-changed:: 5.2
+ .. versionchanged:: 5.2
instantiate the CosmeticChangesToolkit from a page object;
only allow keyword arguments except for page parameter;
`namespace` and `pageTitle` parameters are deprecated
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
`namespace` and `pageTitle` parameters were removed
:param page: the Page object containing the text to be modified
@@ -349,7 +349,7 @@
2. additional information depending on the local site policy
3. interwiki
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
uses :attr:`main_sortkey` to determine the sort key for the
main article within a category. If the main article has a
sort key already, it will not be changed any longer.
@@ -415,7 +415,7 @@
def translateAndCapitalizeNamespaces(self, text: str) -> str:
"""Use localized namespace names.
- .. version-changed:: 7.4
+ .. versionchanged:: 7.4
No longer expect a specific namespace alias for File:
"""
# arz uses English stylish codes
@@ -546,7 +546,7 @@
without using a pipe, if possible
* Capitalize the article title of the link, if appropriate
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
Convert URL-encoded characters if a link is an interwiki link
or different from main namespace.
diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py
index 48004a8..a00c131 100644
--- a/pywikibot/daemonize.py
+++ b/pywikibot/daemonize.py
@@ -89,7 +89,7 @@
Only works on POSIX compatible operating systems. The process will
fork to the background and return control to terminal.
- .. version-changed:: 10.6
+ .. versionchanged:: 10.6
raises NotImplementedError instead of AttributeError if daemonize
is not available for the given platform. Parameters must be given
as keyword-only arguments.
diff --git a/pywikibot/data/__init__.py b/pywikibot/data/__init__.py
index 6c5e1ae..ce04a42 100644
--- a/pywikibot/data/__init__.py
+++ b/pywikibot/data/__init__.py
@@ -1,6 +1,6 @@
"""Module providing several layers of data access to the wiki."""
#
-# (C) Pywikibot team, 2007-2025
+# (C) Pywikibot team, 2007-2023
#
# Distributed under the terms of the MIT license.
#
@@ -13,7 +13,7 @@
"""A mixin to implement wait cycles.
- .. version-added:: 8.4
+ .. versionadded:: 8.4
:ivar int max_retries: Maximum number of times to retry an API
request before quitting. Defaults to ``config.max_retries`` if
diff --git a/pywikibot/data/api/_generators.py b/pywikibot/data/api/_generators.py
index b2ff049..4f6297f 100644
--- a/pywikibot/data/api/_generators.py
+++ b/pywikibot/data/api/_generators.py
@@ -1,6 +1,6 @@
"""Objects representing API/Query generators.
-.. version-changed:: 7.6
+.. versionchanged:: 7.6
All Objects were changed from Iterable object to a Generator object.
They are subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -53,9 +53,9 @@
Subclasses can override :meth:`filter_item` for more complex
filtering logic.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
Renamed from _RequestWrapper.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Introduced :attr:`filter_func` and :meth:`filter_item` for
instance-level item filtering.
"""
@@ -69,7 +69,7 @@
Returns the instance-specific filter if set, otherwise the
class-level default (None by default).
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:return: Callable that accepts an item and returns True to
yield, False to skip; or None to disable filtering
@@ -80,7 +80,7 @@
def filter_func(self, func: Callable[[Any], bool] | None):
"""Set a filter function to apply to items before yielding.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param func: Callable that accepts an item and returns True to
yield, False to skip; or None to disable filtering
@@ -93,7 +93,7 @@
By default, applies :attr:`filter_func` if set. Returns True if
no filter is set.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param item: The item to check
:return: True if the item should be yielded, False otherwise
@@ -120,8 +120,8 @@
def set_maximum_items(self, value: int | str | None) -> None:
"""Set the maximum number of items to be retrieved from the wiki.
- .. version-added:: 7.1
- .. version-changed:: 7.6
+ .. versionadded:: 7.1
+ .. versionchanged:: 7.6
become an abstract method
"""
raise NotImplementedError
@@ -136,7 +136,7 @@
automatically. If the limit attribute is set, the iterator will stop
after iterating that many values.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -219,9 +219,9 @@
Applies :meth:`filter_item()<APIGeneratorBase.filter_item>` to
each item before yielding.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
Changed from iterator method to generator property
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Applies `filter_item` for instance-level filtering.
:yield: Items from the MediaWiki API, filtered by `filter_item()`
@@ -275,7 +275,7 @@
list of pages or links. See the API documentation for specific query
options.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -548,12 +548,12 @@
def continue_update(self) -> None:
"""Update query with continue parameters.
- .. version-added:: 3.0
- .. version-changed:: 4.0
+ .. versionadded:: 3.0
+ .. versionchanged:: 4.0
explicit return a bool value to be used in :meth:`generator`
- .. version-changed:: 6.0
+ .. versionchanged:: 6.0
always return *False*
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
return *None* instead of *False*.
"""
for key, value in self.data[self.continue_name].items():
@@ -634,7 +634,7 @@
passes :meth:`filter_item() <APIGeneratorBase.filter_item>` and
respects namespaces and the generator's limit.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Applies `filter_item()` for instance-level filtering.
:param resultdata: List or iterable of raw API items
@@ -679,9 +679,9 @@
Continues response as needed until limit (if any) is reached.
Each item is already filtered by `_extract_results()`.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
Changed from iterator method to generator property
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Items are filtered via :meth:`filter_item()
<APIGeneratorBase.filter_item>` inside :meth:`_extract_results`.
@@ -771,7 +771,7 @@
Required and optional parameters are as for ``Request``, except
that ``action=query`` is assumed and generator is required.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
retrieve the same imageinfo properties as in
:meth:`APISite.loadimageinfo()
<pywikibot.site._apisite.APISite.loadimageinfo>` with default
@@ -813,11 +813,11 @@
This can be overridden in subclasses to return a different type
of object.
- .. version-changed:: 9.5
+ .. versionchanged:: 9.5
No longer raise :exc:`exceptions.UnsupportedPageError` but
return a generic :class:`pywikibot.Page` object. The exception
is raised when getting the content for example.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
Upcast to :class:`page.FilePage` if *pagedata* has
``imageinfo`` contents even if the file extension is invalid.
"""
@@ -852,7 +852,7 @@
dict for each page queried via a titles= or ids= parameter (which
must be supplied when instantiating this class).
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Supports instance-level filtering via :attr:`filter_func
<APIGenerator.filter_func>` / :meth:`filter_item()
<APIGenerator.filter_item`.
@@ -881,10 +881,10 @@
def generator(self):
"""Yield results from the API, including previously retrieved dicts.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
Changed from iterator method to generator property.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Items are filtered via :meth:`filter_item()
<APIGenerator.filter_item` inside :meth:`_extract_results`.
Previously retrieved dicts in `_previous_dicts` are also
@@ -915,7 +915,7 @@
def _fully_retrieved_data_dicts(self, resultdata):
"""Yield items of self._previous_dicts that are not in resultdata.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Applies :meth:`filter_item()<APIGenerator.filter_item` to
previously stored dicts.
@@ -1064,7 +1064,7 @@
def _update_langlinks(page, langlinks) -> None:
"""Update page langlinks.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
only add a language link if it is found in the family file.
:meta public:
diff --git a/pywikibot/data/api/_optionset.py b/pywikibot/data/api/_optionset.py
index 9e3cd6b..e401db8 100644
--- a/pywikibot/data/api/_optionset.py
+++ b/pywikibot/data/api/_optionset.py
@@ -37,7 +37,7 @@
If a site is given, the module and param must be given too.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*dict* parameter was renamed to *data*.
:param site: The associated site
diff --git a/pywikibot/data/api/_paraminfo.py b/pywikibot/data/api/_paraminfo.py
index 96ddc12..a455b25 100644
--- a/pywikibot/data/api/_paraminfo.py
+++ b/pywikibot/data/api/_paraminfo.py
@@ -39,7 +39,7 @@
preloaded_modules: set[str] | None = None) -> None:
"""Initializer.
- .. version-deprecated:: 8.4
+ .. deprecated:: 8.4
the *modules_only_mode* parameter
:param preloaded_modules: API modules to preload
@@ -283,7 +283,7 @@
For duplicate paths, the value will be False.
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
``normalize_paraminfo`` became a staticmethod.
"""
result_data = {}
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index 51fd559..d77a0c6 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -136,10 +136,10 @@
>>> sorted(data['query'])
['namespaces', 'userinfo']
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
inherited from :class:`WaitingMixin`.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*keys* and *items* methods return a view object instead a list
"""
@@ -405,7 +405,7 @@
def iteritems(self):
"""Implement dict interface.
- .. version-deprecated:: 9.0
+ .. deprecated:: 9.0
Use ``items()`` instead.
"""
return iter(self.items())
@@ -681,10 +681,10 @@
paramstring) -> tuple:
"""Get or post a http request with exception handling.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
change the scheme if the previous request didn't have json
content.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
no wait cycles for :exc:`ImportError` and :exc:`NameError`.
:return: a tuple containing requests.Response object from
@@ -745,7 +745,7 @@
def _json_loads(self, response) -> dict | None:
"""Return a dict from requests.Response.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
show a warning to add a ``protocol()`` method to the family
file if suitable.
@@ -841,9 +841,9 @@
def _handle_warnings(self, result: dict[str, Any]) -> bool:
"""Handle warnings; return True to retry request, False to resume.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
Return True to retry the current request and False to resume.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
Handle warnings of formatversion 2.
.. seealso:: :api:`Errors and warnings`
@@ -888,7 +888,7 @@
Return True to retry the request, False to resume and None if
the warning is not handled.
- .. version-added:: 7.2
+ .. versionadded:: 7.2
:meta public:
"""
@@ -1007,7 +1007,7 @@
Also reset last API error with wait cycles.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
:param delay: Minimum time in seconds to wait. Overwrites
``retry_wait`` variable if given. The delay doubles each
@@ -1019,10 +1019,10 @@
def submit(self) -> dict:
"""Submit a query and parse the response.
- .. version-changed:: 8.0.4
+ .. versionchanged:: 8.0.4
in addition to *readapidenied* also try to login when API
response is *notloggedin*.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Raise :exc:`exceptions.APIError` if the same error comes
twice in a row within the loop.
@@ -1201,7 +1201,7 @@
"""Cached request.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
timestamp with timezone is used to determine expiry.
"""
@@ -1232,9 +1232,9 @@
The directory will be created if it does not already exist.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
return a `pathlib.Path` object.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
remove Python main version from directory name
:return: base directory path for cache entries
@@ -1250,10 +1250,10 @@
def _make_dir(dir_name: str | Path) -> Path:
"""Create directory if it does not exist already.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
Only `FileExistsError` is ignored but other OS exceptions can
be still raised
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
use *dir_name* as str or `pathlib.Path` object but always
return a Path object.
@@ -1298,7 +1298,7 @@
def _cachefile_path(self) -> Path:
"""Create the cachefile path.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
return a `pathlib.Path` object.
:meta public:
diff --git a/pywikibot/data/citoid.py b/pywikibot/data/citoid.py
index d31b4e2..96a4326 100644
--- a/pywikibot/data/citoid.py
+++ b/pywikibot/data/citoid.py
@@ -1,6 +1,6 @@
"""Citoid Query interface.
-.. version-added:: 10.6
+.. versionadded:: 10.6
"""
#
# (C) Pywikibot team, 2025
diff --git a/pywikibot/data/memento.py b/pywikibot/data/memento.py
index 06d6dd5..83784cc 100644
--- a/pywikibot/data/memento.py
+++ b/pywikibot/data/memento.py
@@ -1,7 +1,7 @@
"""Fix ups for memento-client package version 0.6.1.
-.. version-added:: 7.4
-.. version-changed:: 10.7
+.. versionadded:: 7.4
+.. versionchanged:: 10.7
Set default timegate to :attr:`DEFAULT_TIMEGATE_BASE_URI`
.. seealso:: https://github.com/mementoweb/py-memento-client#readme
"""
@@ -45,9 +45,9 @@
It makes it straightforward to access the Web of the past as it is
to access the current Web.
- .. version-changed:: 7.4
+ .. versionchanged:: 7.4
`timeout` is used in several methods.
- .. version-changed:: 10.7
+ .. versionchanged:: 10.7
Set default timegate to :attr`DEFAULT_TIMEGATE_BASE_URI`
Basic usage:
@@ -278,7 +278,7 @@
timeout: int | None = None) -> requests.Response:
"""Makes HEAD requests.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
The default timout was increased from 9 to 30 seconds.
:param uri: the uri for the request.
@@ -332,7 +332,7 @@
timeout: int | None = None):
"""Get most recent memento for url.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
The *timeout* parameter.
:param url: The input http url.
diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py
index b5dfb71..01298a3 100644
--- a/pywikibot/data/sparql.py
+++ b/pywikibot/data/sparql.py
@@ -29,7 +29,7 @@
This class allows to run SPARQL queries against any SPARQL endpoint.
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
inherited from :class:`data.WaitingMixin` which provides a
:meth:`data.WaitingMixin.wait` method.
"""
@@ -130,10 +130,10 @@
def query(self, query: str, headers: dict[str, str] | None = None):
"""Run SPARQL query and return parsed JSON result.
- .. version-changed:: 8.5
+ .. versionchanged:: 8.5
:exc:`exceptions.NoUsernameError` is raised if the response
looks like the user is not logged in.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
retry on internal server error (500).
:param query: Query text
diff --git a/pywikibot/data/superset.py b/pywikibot/data/superset.py
index 51a2dc9..d07ade8 100644
--- a/pywikibot/data/superset.py
+++ b/pywikibot/data/superset.py
@@ -4,7 +4,7 @@
This module only works with a *client login* (including 2FA).
It does **not** work with BotPassword or OAuth accounts.
-.. version-added:: 9.2
+.. versionadded:: 9.2
"""
#
# (C) Pywikibot team, 2024-2025
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index cb4b3c6..e3570cf 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -25,7 +25,7 @@
The methods accept a Pywikibot family name as the WikiStats table name,
mapping the names before calling the WikiStats API.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
tables are cached globally instead by instances.
"""
diff --git a/pywikibot/date.py b/pywikibot/date.py
index 736df79..a275384 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -335,7 +335,7 @@
def intToRomanNum(i: int) -> str:
"""Convert integer to roman numeral.
- .. version-changed:: 9.5
+ .. versionchanged:: 9.5
negative *i* is no longer accepted but 31 is a valid value.
:raises IndexError: Roman value *i* is nont in range 0..31
@@ -348,7 +348,7 @@
def romanNumToInt(v: str) -> int:
"""Convert roman numeral to integer.
- .. version-changed:: 9.5
+ .. versionchanged:: 9.5
``XXXI`` can be converted.
"""
return _romanNumbers.index(v)
@@ -469,7 +469,7 @@
lambda v: dh(v, 'pattern string', encf, decf)
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*filter* parameter was renamed to *filter_func*
:param encf: Converts from an integer parameter to another integer
diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 4810942..4107f67 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -641,7 +641,7 @@
>>> get_close_matches_ratio('Pywikibot', p, n=2, cutoff=0, ignorecase=True)
[(0.4444444444444444, 'Wikipedia'), (0.42857142857142855, 'Robot')]
- .. version-added:: 9.4
+ .. versionadded:: 9.4
.. note:: Most code is incorporated from Python software under the
`PSF`_ license.
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index b853da5..2dcd683 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -17,18 +17,18 @@
"""A notification issued by the Echo extension.
- .. version-changed:: 3.0.20190204
+ .. versionchanged:: 3.0.20190204
The ``id`` attribute was renamed to ``event_id``, and its type
changed from ``str`` to ``int``.
- .. version-deprecated:: 3.0.20190204
+ .. deprecated:: 3.0.20190204
The ``id`` attribute was retained temporarily for backward
compatibility, but is deprecated and scheduled for removal.
- .. version-removed:: 7.0
+ .. versionremoved:: 7.0
The ``id`` attribute was removed.
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
The class is now defined using the ``@dataclass`` decorator to
simplify internal initialization and improve maintainability.
"""
diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index bec6552..4b6d578 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -39,7 +39,7 @@
"""Text editor.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Editor detection functions were moved from :mod:`config`.
"""
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index a55f1e5..ac14c12 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -159,15 +159,15 @@
- ArgumentDeprecationWarning: command line argument problems
- FamilyMaintenanceWarning: missing information in family definition
-.. version-changed:: 6.0
+.. versionchanged:: 6.0
exceptions were renamed and are ending with "Error".
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
All Pywikibot Error exceptions must be imported from
``pywikibot.exceptions``. Deprecated exceptions identifiers were
removed.
-.. version-changed:: 8.1
+.. versionchanged:: 8.1
``Server414Error`` class is deprecated; use :class:`Client414Error`
instead.
"""
@@ -286,7 +286,7 @@
This class should be used when the Exception concerns a particular
Page, and when a generic message can be written once for all.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
A pageid is accepted with the first parameter
"""
@@ -381,7 +381,7 @@
"""Expected rename target user not found.
- .. version-added:: 9.4
+ .. versionadded:: 9.4
"""
message = 'Rename target user of {} not found.'
@@ -412,11 +412,11 @@
"""ItemPage has no sitelink to the given site.
- .. version-added:: 8.1
- .. version-deprecated:: 8.1
+ .. versionadded:: 8.1
+ .. deprecated:: 8.1
This exception depends on :exc:`NoPageError` but it will be
removed.
- .. version-removed:: 11.0
+ .. versionremoved:: 11.0
Dependency on :exc:`NoPageError` was removed.
"""
@@ -507,7 +507,7 @@
"""Missing page history.
- .. version-added:: 6.2
+ .. versionadded:: 6.2
"""
message = 'Page {} is invalid.'
@@ -617,7 +617,7 @@
"""Got unexpected server response due to client issue.
- .. version-added:: 8.1
+ .. versionadded:: 8.1
"""
@@ -625,7 +625,7 @@
"""Server returned with HTTP 414 code.
- .. version-added:: 8.1
+ .. versionadded:: 8.1
"""
diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py
index 43adfbe..527ce55 100644
--- a/pywikibot/families/commons_family.py
+++ b/pywikibot/families/commons_family.py
@@ -13,7 +13,7 @@
"""Family class for Wikimedia Commons.
- .. version-changed:: 6.5
+ .. versionchanged:: 6.5
:meth:`family.WikibaseFamily.interface` was changed to
:class:`DataSite<pywikibot.site._datasite.DataSite>` to enable
structured data.
diff --git a/pywikibot/families/foundation_family.py b/pywikibot/families/foundation_family.py
index 2711283..3e57da8 100644
--- a/pywikibot/families/foundation_family.py
+++ b/pywikibot/families/foundation_family.py
@@ -1,9 +1,9 @@
"""Family module for Foundation wiki.
-.. version-added:: 3.0
+.. versionadded:: 3.0
"""
#
-# (C) Pywikibot team, 2019-2025
+# (C) Pywikibot team, 2019-2022
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Foundation wiki.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
name = 'foundation'
diff --git a/pywikibot/families/lingualibre_family.py b/pywikibot/families/lingualibre_family.py
index ea1bea5..6b81c93 100644
--- a/pywikibot/families/lingualibre_family.py
+++ b/pywikibot/families/lingualibre_family.py
@@ -1,9 +1,9 @@
"""Family module for Lingua Libre.
-.. version-added:: 6.5
+.. versionadded:: 6.5
"""
#
-# (C) Pywikibot team, 2021-2025
+# (C) Pywikibot team, 2021-2024
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Lingua Libre.
- .. version-added:: 6.5
+ .. versionadded:: 6.5
"""
name = 'lingualibre'
diff --git a/pywikibot/families/wikifunctions_family.py b/pywikibot/families/wikifunctions_family.py
index df510ab..b240a1f 100644
--- a/pywikibot/families/wikifunctions_family.py
+++ b/pywikibot/families/wikifunctions_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikifunction.
-.. version-added:: 8.4
+.. versionadded:: 8.4
"""
#
-# (C) Pywikibot team, 2023-2025
+# (C) Pywikibot team, 2023
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/families/wikihow_family.py b/pywikibot/families/wikihow_family.py
index 030b7a2..6e4fae8 100644
--- a/pywikibot/families/wikihow_family.py
+++ b/pywikibot/families/wikihow_family.py
@@ -1,9 +1,9 @@
"""Family module for wikiHow wiki.
-.. version-added:: 3.0
+.. versionadded:: 3.0
"""
#
-# (C) Pywikibot team, 2020-2025
+# (C) Pywikibot team, 2020-2024
#
# Distributed under the terms of the MIT license.
#
@@ -17,7 +17,7 @@
"""Family class for wikiHow Wiki.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
name = 'wikihow'
diff --git a/pywikibot/families/wikimania_family.py b/pywikibot/families/wikimania_family.py
index 159b146..a43a36a 100644
--- a/pywikibot/families/wikimania_family.py
+++ b/pywikibot/families/wikimania_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikimania wikis.
-.. version-added:: 3.0
+.. versionadded:: 3.0
"""
#
-# (C) Pywikibot team, 2017-2025
+# (C) Pywikibot team, 2017-2024
#
# Distributed under the terms of the MIT license.
#
@@ -18,7 +18,7 @@
"""Family class for Wikimania wikis.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
name = 'wikimania'
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index 185e52b..ce0cbb6f 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -229,7 +229,7 @@
def __post_init__(cls) -> None:
"""Add 'yue' code alias due to :phab:`T341960`.
- .. version-added:: 8.3
+ .. versionadded:: 8.3
"""
aliases = cls.code_aliases.copy()
aliases['yue'] = 'zh-yue'
diff --git a/pywikibot/families/wikispore_family.py b/pywikibot/families/wikispore_family.py
index e229d7e..f07a42b 100644
--- a/pywikibot/families/wikispore_family.py
+++ b/pywikibot/families/wikispore_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikispore.
-.. version-added:: 4.1
+.. versionadded:: 4.1
"""
#
-# (C) Pywikibot team, 2020-2025
+# (C) Pywikibot team, 2020-2023
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Wikispore.
- .. version-added:: 4.1
+ .. versionadded:: 4.1
"""
name = 'wikispore'
diff --git a/pywikibot/families/wiktionary_family.py b/pywikibot/families/wiktionary_family.py
index f0373bb..1f238a0 100644
--- a/pywikibot/families/wiktionary_family.py
+++ b/pywikibot/families/wiktionary_family.py
@@ -14,7 +14,7 @@
"""Family class for Wiktionary.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
``alphabetic_sv`` attribute was removed; ``interwiki_putfirst``
attribute was removed and default setting from parent class is
used.
@@ -96,7 +96,7 @@
def __post_init__(cls) -> None:
"""Add 'zh-yue' code alias due to :phab:`T341960`.
- .. version-added:: 8.3
+ .. versionadded:: 8.3
"""
aliases = cls.code_aliases.copy()
aliases['zh-yue'] = 'yue'
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index ca61b4b..bdc5918 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -58,7 +58,7 @@
def categories_last(cls):
"""Property listing site keys for categories at last position.
- .. version-deprecated:: 10.3
+ .. deprecated:: 10.3
use :meth:`site.has_extension('CategorySelect')
<pywikibot.site._apisite.APISite.has_extension>` instead
"""
diff --git a/pywikibot/family.py b/pywikibot/family.py
index fb26879..828e28a 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -47,17 +47,17 @@
Families are immutable and initializer is unsupported. Any class
modification should go to :meth:`__post_init__` class method.
- .. version-changed:: 3.0
+ .. versionchanged:: 3.0
the family class is immutable. Having an ``__init__`` initializer
method a ``NotImplementedWarning`` will be given.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
``alphabetic``, ``alphabetic_revised`` and ``fyinterwiki``
attributes where removed.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
:attr:`obsolete` setter was removed.
- .. version-changed:: 8.3
+ .. versionchanged:: 8.3
Having an initializer method a ``FutureWarning`` will be given.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
raises RuntimeError if an initializer method was found;
:meth:`__post_init__` classmethod should be used instead.
"""
@@ -316,7 +316,7 @@
.. warning:: This attribute is used within ``re.sub()`` method. Use
escape sequence if necessary
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
_families: dict[str, Family] = {}
@@ -326,7 +326,7 @@
def categories_last(cls) -> list[str]:
"""Categories come after interwiki links for the given site codes.
- .. version-deprecated:: 10.3
+ .. deprecated:: 10.3
use :meth:`site.has_extension('CategorySelect')
<pywikibot.site._apisite.APISite.has_extension>` instead
"""
@@ -430,14 +430,14 @@
def get_edit_restricted_templates(self, code):
"""Return tuple of edit restricted templates.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
return self.edit_restricted_templates.get(code, ())
def get_archived_page_templates(self, code):
"""Return tuple of archived page templates.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
return self.archived_page_templates.get(code, ())
@@ -461,7 +461,7 @@
May be overridden to return 'http'. Other protocols are not
supported.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
``https`` is returned instead of ``http``.
:param code: language code
@@ -472,7 +472,7 @@
def verify_SSL_certificate(self, code: str) -> bool:
"""Return whether a HTTPS certificate should be verified.
- .. version-added:: 5.3
+ .. versionadded:: 5.3
renamed from ignore_certificate_error
:param code: language code
@@ -550,14 +550,14 @@
def eventstreams_host(self, code) -> NoReturn:
"""Hostname for EventStreams.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
raise NotImplementedError('This family does not support EventStreams')
def eventstreams_path(self, code) -> NoReturn:
"""Return path for EventStreams.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
raise NotImplementedError('This family does not support EventStreams')
@@ -592,10 +592,10 @@
applies and then iterates over :attr:`Family.codes` to actually
determine which code applies.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*url* parameter does not have to contain a api/query/script
path
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
accept a trailing slash in *url* after domain.
:param url: the URL which may contain a ``$1``. If it's missing
@@ -698,7 +698,7 @@
def isPublic(self, code) -> bool:
"""Check the wiki require logging in before viewing it.
- .. version-deprecated:: 10.6
+ .. deprecated:: 10.6
"""
return True
@@ -753,9 +753,9 @@
xx: now should get code yy:, add {'xx':'yy'} to
:attr:`code_aliases`.
- .. version-deprecated:: 10.6
+ .. deprecated:: 10.6
Use :attr:`code_aliases` directly instead.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
changed from dict to invariant mapping.
"""
return types.MappingProxyType(cls.code_aliases)
@@ -767,7 +767,7 @@
Codes that should be removed, usually because the site has been
taken down.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
changed from list to invariant frozenset.
"""
return frozenset(cls.removed_wikis + cls.closed_wikis)
@@ -834,7 +834,7 @@
"""Common features of Fandom families.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
renamed from WikiaFamily
"""
@@ -857,7 +857,7 @@
"""Class for all wikimedia families.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
:attr:`knows_codes` attribute was added.
"""
@@ -1023,7 +1023,7 @@
They should be roughly sorted by size.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Sorting order is retrieved via :mod:`wikistats` for each call.
:raises NotImplementedError: Family is not member of
@@ -1069,7 +1069,7 @@
"""A base class for a Wikibase Family.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
"""
def interface(self, code) -> str:
@@ -1106,7 +1106,7 @@
.. warning:: Possibly you have to adjust the repository site in
:meth:`WikibaseFamily.entity_sources` to get the valid entity.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
"""
@property
diff --git a/pywikibot/fixes.py b/pywikibot/fixes.py
index 5d4ba04..22f0805 100644
--- a/pywikibot/fixes.py
+++ b/pywikibot/fixes.py
@@ -1,6 +1,6 @@
"""File containing all standard fixes.
-.. version-removed:: 11.0
+.. versionremoved:: 11.0
The ``yu-tld`` predefined fix was removed.
"""
#
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 9efd81f..dbbabe9 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -416,7 +416,7 @@
For internal use, don't use it directly.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
filename = f'{dirname}/{lang}.json'
try:
@@ -565,11 +565,11 @@
For PLURAL support have a look at the :func:`twtranslate` function.
- .. version-changed:: 2.0
+ .. versionchanged:: 2.0
*parameter* other than a mapping (or None) is deprecated.
- .. version-changed:: 6.2
+ .. versionchanged:: 6.2
ValueError is raised if *parameter* is not a mapping.
- .. version-changed:: 10.2
+ .. versionchanged:: 10.2
TypeError instead of ValueError is raised if *parameter* is not a
mapping.
@@ -662,7 +662,7 @@
.. note:: If *source* is a str and ``config.bot_prefix`` is set to
None, it cannot be determined whether the current user is a bot
account. In this cas the prefix will be returned.
- .. version-added:: 8.1
+ .. versionadded:: 8.1
:param source: When it's a site it's using the lang attribute and otherwise
it is using the value directly.
@@ -746,10 +746,10 @@
... ) % {'descr': 'seulement'})
'Robot: Changer seulement quelques pages.'
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
the *bot_prefix* parameter was added.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
*fallback_prompt* is now returned whenever no translation is found,
including unknown keys in existing packages.
@@ -907,7 +907,7 @@
>>> path.parent.as_posix()
'scripts/i18n'
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:param stem: yield the Path.stem if True and the Path object otherwise
"""
@@ -945,7 +945,7 @@
langs.add(fname.stem)
return sorted(langs)
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
return sorted(
{fname.stem for dirpath in bundles() for fname in dirpath.iterdir()
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index e357ea7..e82fb95 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -1,6 +1,6 @@
"""Objects representing MediaWiki log entries."""
#
-# (C) Pywikibot team, 2007-2025
+# (C) Pywikibot team, 2007-2024
#
# Distributed under the terms of the MIT license.
#
@@ -97,7 +97,7 @@
def params(self) -> dict[str, Any]:
"""Additional data for some log entry types.
- .. version-added:: 9.4
+ .. versionadded:: 9.4
private *_param* attribute became a public property
"""
return self.get('params', {})
@@ -211,7 +211,7 @@
def oldgroups(self) -> list[str]:
"""Return old rights groups.
- .. version-changed:: 7.5
+ .. versionchanged:: 7.5
No longer raise KeyError if `oldgroups` does not exists or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
@@ -222,7 +222,7 @@
def newgroups(self) -> list[str]:
"""Return new rights groups.
- .. version-changed:: 7.5
+ .. versionchanged:: 7.5
No longer raise KeyError if `oldgroups` does not exists or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
diff --git a/pywikibot/logging.py b/pywikibot/logging.py
index ceb2364..cd60dcb 100644
--- a/pywikibot/logging.py
+++ b/pywikibot/logging.py
@@ -105,10 +105,10 @@
``exc_info=True``, which causes the log message to include an
exception traceback.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
Positional arguments for *decoder* and *newline* are deprecated;
keyword arguments should be used.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
@@ -166,11 +166,11 @@
>>> info('Pywikibot %(version)d', {'version': 10}) # doctest: +SKIP
Pywikibot 10
- .. version-added:: 7.2
+ .. versionadded:: 7.2
was renamed from :func:`output`. Positional arguments for
*decoder* and *newline* are deprecated; keyword arguments should
be used. Keyword parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
@@ -184,7 +184,7 @@
"""Synonym for :func:`info` for backward compatibility. The arguments are
interpreted as for :func:`logoutput`.
-.. version-changed:: 7.2
+.. versionchanged:: 7.2
was renamed to :func:`info`; `text` was renamed to `msg`; `msg`
paramerer may be omitted; only keyword arguments are allowed except
for `msg`. Keyword parameter *layer* was added.
@@ -203,11 +203,11 @@
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`text` was renamed to `msg`; `msg` parameter may be omitted;
only keyword arguments are allowed except for `msg`. Keyword
parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -223,10 +223,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -241,10 +241,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -258,10 +258,10 @@
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -276,10 +276,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -294,10 +294,10 @@
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`layer` parameter is optional; `text` was renamed to `msg`;
only keyword arguments are allowed except for `msg`.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -330,13 +330,13 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
only keyword arguments are allowed except for `msg`;
`exc_info` keyword is to be used instead of `tb`. Keyword
parameter *layer* was added.
- .. version-changed:: 7.3
+ .. versionchanged:: 7.3
`exc_info` is True by default
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
diff --git a/pywikibot/login.py b/pywikibot/login.py
index e26555f..4565fec 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -122,7 +122,7 @@
def __repr__(self) -> str:
"""Return representation string for LoginManager.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
"""
return f'{type(self).__name__}(user={self.username!r})'
@@ -216,10 +216,10 @@
('en', 'wikipedia', 'my_en_wikipedia_user', 'my_en_wikipedia_pass')
('my_username', BotPassword('my_suffix', 'my_password'))
- .. version-changed:: 10.2
+ .. versionchanged:: 10.2
Raises ValueError instead of AttributeError if password_file
is not set.
- .. version-changed:: 10.7.1
+ .. versionchanged:: 10.7.1
Due to vulnerability issue the password lines are no longer
evaluated as Python source but parsed as literals.
Raises ValueError if an exception occurs while evaluating a
@@ -362,10 +362,10 @@
"""Supply login_to_site method to use API interface.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
2FA login was enabled. LoginManager was moved from :mod:`data.api`
to :mod:`login` module and renamed to *ClientLoginManager*.
- .. version-changed:: 10.2
+ .. versionchanged:: 10.2
Secondary authentication via email was enabled.
.. seealso::
- https://www.mediawiki.org/wiki/Extension:OATHAuth
@@ -421,9 +421,9 @@
Note, this doesn't do anything with cookies. The http module
takes care of all the cookie stuff. Throws exception on failure.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
2FA login was implemented.
- .. version-changed:: 10.2
+ .. versionchanged:: 10.2
Secondary authentication via email was implemented.
:raises RuntimeError: Unexpected API login response key or
@@ -658,7 +658,7 @@
Implemented to discard user interaction token fetching,
usually for tests.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
"""
return self._access_token
@@ -671,7 +671,7 @@
def identity(self) -> dict[str, Any] | None:
"""Get identifying information about a user via an authorized token.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
*leeway* parameter for ``mwoauth.identify`` function was
increased to 30.0 seconds.
"""
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index 14e4bc1..db6cacd 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -363,7 +363,7 @@
...
pywikibot.exceptions.IsRedirectPageError: ... is a redirect page.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
:exc:`exceptions.SectionError` is raised if the
:meth:`section` does not exists
.. seealso:: :attr:`text` property
@@ -403,7 +403,7 @@
Not existing pages are considered loaded.
- .. version-added:: 7.6
+ .. versionadded:: 7.6
"""
return not self.exists() or self._latest_cached_revision() is not None
@@ -443,7 +443,7 @@
) -> pywikibot.page.Revision:
"""Return an old revision of this page.
- .. version-added:: 9.6
+ .. versionadded:: 9.6
.. seealso:: :meth:`getOldVersion`
@@ -459,7 +459,7 @@
def getOldVersion(self, oldid, force: bool = False) -> str:
"""Return text of an old revision of this page.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
The unused parameter *get_redirect* was removed.
.. seealso:: :meth:`get_revision`
@@ -624,7 +624,7 @@
def get_parsed_page(self, force: bool = False) -> str:
"""Retrieve parsed text (via action=parse) and cache it.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
`force` parameter was added;
`_get_parsed_page` becomes a public method
@@ -645,7 +645,7 @@
intro: bool = True) -> str:
"""Retrieve an extract of this page.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
:param variant: The variant of extract, either 'plain' for plain
text, 'html' for limited HTML (both excludes templates and
@@ -746,7 +746,7 @@
def userName(self) -> str:
"""Return name or IP address of last user to edit page.
- .. version-deprecated:: 9.3
+ .. deprecated:: 9.3
Use :attr:`latest_revision.user<latest_revision>`
instead.
"""
@@ -756,7 +756,7 @@
def isIpEdit(self) -> bool:
"""Return True if last editor was unregistered.
- .. version-deprecated:: 9.3
+ .. deprecated:: 9.3
Use :attr:`latest_revision.anon<latest_revision>`
instead.
"""
@@ -817,7 +817,7 @@
A static redirect must be a valid redirect, and contain the magic
word __STATICREDIRECT__.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
__STATICREDIRECT__ can be transcluded
:param force: Bypass local caching
@@ -1072,7 +1072,7 @@
:param total: maximum number of redirects to retrieve in total
:param content: load the current content of each redirect
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
return self.site.page_redirects(
self,
@@ -1278,15 +1278,15 @@
**kwargs) -> None:
"""Save the current contents of page's text to the wiki.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
boolean *watch* parameter is deprecated
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
*botflag* parameter was renamed to *bot*.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
edits cannot be marked as bot edits if the bot account has no
``bot`` right. Therefore a ``None`` argument for *bot*
parameter was dropped.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
boolean *watch* parameter is desupported
.. hint:: Setting up :manpage:`OAuth` or :manpage:`BotPassword
@@ -1426,11 +1426,11 @@
For new code, using :meth:`save` is preferred; also ee that
method docs for all parameters not listed here.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
The `show_diff` parameter
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
*botflag* parameter was renamed to *bot*.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
edits cannot be marked as bot edits if the bot account has no
``bot`` right. Therefore a ``None`` argument for *bot*
parameter was dropped.
@@ -1457,7 +1457,7 @@
) -> bool:
"""Add or remove this page from the bot account's watchlist.
- .. version-changed:: 10.4.0
+ .. versionchanged:: 10.4.0
Added the *expiry* parameter to specify watch expiry time.
Positional parameters are deprecated; all parameters must be
passed as keyword arguments.
@@ -1524,7 +1524,7 @@
.. note:: This discards content saved to self.text.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
*botflag* parameter was renamed to *bot*.
"""
if not self.exists():
@@ -1550,9 +1550,9 @@
For the parameters refer
:py:mod:`APISite.pagelinks<pywikibot.site.APISite.pagelinks>`
- .. version-added:: 7.0
+ .. versionadded:: 7.0
the `follow_redirects` keyword argument.
- .. version-removed:: 10.0
+ .. versionremoved:: 10.0
the positional arguments.
.. seealso::
@@ -1663,12 +1663,12 @@
method caches the result. If *namespaces* is used, all pages are
retrieved and cached but the result is filtered.
- .. version-changed:: 2.0
+ .. versionchanged:: 2.0
a list of :class:`pywikibot.Page` is returned instead of a
list of template titles. The given pages may have namespaces
different from TEMPLATE namespace. *get_redirect* parameter
was removed.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
*namespaces* parameter was added; all parameters must be given
as keyword arguments.
@@ -1711,8 +1711,8 @@
but they can be yielded from the cache of a previous
:meth:`templates` call.
- .. version-added:: 2.0
- .. version-changed:: 9.2
+ .. versionadded:: 2.0
+ .. versionchanged:: 9.2
*namespaces* parameter was added; all parameters except
*total* must be given as keyword arguments.
@@ -1756,10 +1756,10 @@
) -> Iterable[pywikibot.Page]:
"""Iterate categories that the article is in.
- .. version-changed:: 2.0
+ .. versionchanged:: 2.0
*with_sort_key* parameter is not supported and a
NotImplementedError is raised if set.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
*with_sort_key* parameter is supported.
.. seealso:: :meth:`Site.pagecategories()
<pywikibot.site._generators.GeneratorsMixin.pagecategories>`
@@ -1832,7 +1832,7 @@
ignore_section: bool = True) -> pywikibot.Page:
"""Return a Page object for the target this Page redirects to.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
*ignore_section* parameter
.. seealso::
@@ -1977,7 +1977,7 @@
movesubpages: bool = True) -> pywikibot.page.Page:
"""Move this page to a new title.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
The *movesubpages* parameter was added
:param newtitle: The new page title.
@@ -1998,7 +1998,7 @@
def rollback(self, **kwargs: Any) -> dict[str, int | str]:
"""Roll back this page to the version before the last edit by a user.
- .. version-added:: 10.5
+ .. versionadded:: 10.5
.. seealso::
:meth:`Site.rollbackpage()
@@ -2050,7 +2050,7 @@
) -> int:
"""Delete the page from the wiki. Requires administrator status.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
keyword only parameter *deletetalk* was added.
:param reason: The edit summary for the deletion, or rationale
@@ -2120,7 +2120,7 @@
def has_deleted_revisions(self) -> bool:
"""Return True if the page has deleted revisions.
- .. version-added:: 4.2
+ .. versionadded:: 4.2
"""
if not hasattr(self, '_has_deleted_revisions'):
gen = self.site.deletedrevs(self, total=1, prop=['ids'])
@@ -2307,7 +2307,7 @@
show_diff: bool = False) -> bool:
"""Remove page from oldCat and add it to newCat.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
The `show_diff` parameter
:param old_cat: category to be removed
diff --git a/pywikibot/page/_category.py b/pywikibot/page/_category.py
index 37fe8d9..5115d45e 100644
--- a/pywikibot/page/_category.py
+++ b/pywikibot/page/_category.py
@@ -105,7 +105,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
all parameters are keyword arguments only. Additional
parameters are supported. The order of subcategories are
yielded was changed. The old order was
@@ -162,7 +162,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
all parameters are keyword arguments only.
:param recurse: if not False or 0, also iterate articles in
@@ -227,7 +227,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
all parameters are keyword arguments only. Additional
parameters are supported.
diff --git a/pywikibot/page/_collections.py b/pywikibot/page/_collections.py
index dad0c62..dea73af 100644
--- a/pywikibot/page/_collections.py
+++ b/pywikibot/page/_collections.py
@@ -149,7 +149,7 @@
def normalizeData(cls, data: dict) -> dict:
"""Helper function to expand data into the Wikibase API structure.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
raises TypeError if *data* value is not a list.
:param data: Data to normalize
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index b3dec04..1489c6e 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -42,11 +42,11 @@
ignore_extension: bool = False) -> None:
"""Initializer.
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
Check for valid extensions.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
Added the optional *ignore_extension* parameter.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
Show a warning if *ignore_extension* was set and the
extension is invalid.
.. seealso::
@@ -133,7 +133,7 @@
This function will load also metadata.
It is also used as a helper in FileInfo to load metadata lazily.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
:param ts: timestamp of the Image rev. to retrieve
@@ -213,7 +213,7 @@
def file_is_shared(self) -> bool:
"""Check if the file is stored on any known shared repository.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
return False if file does not exist on shared image repository
instead raising NoPageError.
"""
@@ -266,11 +266,11 @@
'Pywikibot'
.. seealso:: :meth:`globalusage`
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
all parameters from :meth:`APISite.imageusage()
<pywikibot.site._generators.GeneratorsMixin.imageusage>`
are available.
- .. version-changed:: 7.4
+ .. versionchanged:: 7.4
renamed from :meth:`usingPages`.
"""
return self.site.imageusage(self, **kwargs)
@@ -279,7 +279,7 @@
def file_is_used(self) -> bool:
"""Check whether the file is used at this site.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
"""
return bool(list(self.using_pages(total=1)))
@@ -361,9 +361,9 @@
The suffix has changed and Pywikibot_MW_gear_icon.png was
downloaded.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
*url_width*, *url_height* and *url_param* parameters.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*filename* argument may be also a path-like object or an
iterable of path segments.
.. note:: filename suffix is adjusted if target url's suffix is
@@ -445,7 +445,7 @@
the method returns the associated mediainfo entity. Otherwise,
it falls back to the behavior of :meth:`BasePage.data_item`.
- .. version-added:: 6.5
+ .. versionadded:: 6.5
:rtype: pywikibot.page.WikibaseEntity
"""
@@ -474,10 +474,10 @@
.. note:: timestamp will be casted to :func:`pywikibot.Timestamp`.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
raises KeyError instead of AttributeError if FileInfo is used as
Mapping.
- .. version-changed:: 8.6
+ .. versionchanged:: 8.6
Metadata are loaded lazily.
Added *filepage* parameter.
"""
@@ -491,7 +491,7 @@
def update(self, file_revision) -> None:
"""Update FileInfo with new values.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
"""
for k, v in file_revision.items():
if k == 'timestamp':
@@ -518,7 +518,7 @@
def metadata(self):
"""Return metadata.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
"""
if self._metadata is None:
self.filepage.get_file_info(self.timestamp)
@@ -528,6 +528,6 @@
def metadata(self, value) -> None:
"""Set metadata.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
"""
self._metadata = value
diff --git a/pywikibot/page/_links.py b/pywikibot/page/_links.py
index 57c130b..639cd30 100644
--- a/pywikibot/page/_links.py
+++ b/pywikibot/page/_links.py
@@ -6,7 +6,7 @@
its contents.
"""
#
-# (C) Pywikibot team, 2008-2025
+# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
#
@@ -649,7 +649,7 @@
- badges: Any badges associated with the sitelink
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
# Components used for __repr__
diff --git a/pywikibot/page/_page.py b/pywikibot/page/_page.py
index b02390f..8a5a5a7 100644
--- a/pywikibot/page/_page.py
+++ b/pywikibot/page/_page.py
@@ -133,7 +133,7 @@
) -> None:
"""Change the page's text to point to the redirect page.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
*botflag* keyword parameter was renamed to *bot*.
:param target_page: target of the redirect, this argument is
@@ -188,7 +188,7 @@
Return the first 'preferred' ranked Claim specified by Wikibase
property or the first 'normal' one otherwise.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
.. seealso:: :meth:`pywikibot.ItemPage.get_best_claim`
diff --git a/pywikibot/page/_toolforge.py b/pywikibot/page/_toolforge.py
index 389adc3..e6c5820 100644
--- a/pywikibot/page/_toolforge.py
+++ b/pywikibot/page/_toolforge.py
@@ -1,6 +1,6 @@
"""Object representing interface to toolforge tools.
-.. version-added:: 7.7
+.. versionadded:: 7.7
"""
#
# (C) Pywikibot team, 2022-2025
@@ -22,7 +22,7 @@
"""Page mixin for main authorship.
- .. version-added:: 7.7
+ .. versionadded:: 7.7
"""
#: Supported wikipedia site codes
@@ -59,7 +59,7 @@
>>> auth.most_common(1)
[('DrTrigon', 37)]
- .. version-deprecated:: 9.3
+ .. deprecated:: 9.3
use :meth:`authorship` instead.
.. seealso:: :meth:`authorship` for further informations
@@ -99,10 +99,10 @@
.. important:: Only implemented for pages in Main, Project,
Category and Template namespaces and only wikipedias of
:attr:`WIKIBLAME_CODES` are supported.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
XTools is used to retrieve authors. This method replaces
:meth:`main_authors`.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
WikiHistory is used to retrieve authors due to :phab:`T392694`.
Here are the differences between these two implementations:
@@ -111,7 +111,7 @@
.. tab:: WikiHistory
- .. version-added:: 10.1
+ .. versionadded:: 10.1
- Implemented from version 7.7 until 9.2 (with
:meth:`main_authors` method) and from 10.1.
@@ -131,7 +131,7 @@
.. tab:: XTools
- .. version-removed:: 10.1
+ .. versionremoved:: 10.1
- Implemented from version 9.3 until 10.0.
- Only Main namespace is supported.
diff --git a/pywikibot/page/_user.py b/pywikibot/page/_user.py
index 7dfce2c..9d4ea52 100644
--- a/pywikibot/page/_user.py
+++ b/pywikibot/page/_user.py
@@ -95,7 +95,7 @@
def is_CIDR(self) -> bool: # noqa: N802
"""Determine if the input refers to a range of IP addresses.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
.. seealso::
- :meth:`isRegistered`
- :meth:`isAnonymous`
@@ -106,7 +106,7 @@
def getprops(self, force: bool = False) -> dict[str, Any]:
"""Return a properties about the user.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
detect range blocks
:param force: if True, forces reloading the data from API
@@ -150,9 +150,9 @@
def is_blocked(self, force: bool = False) -> bool:
"""Determine whether the user is currently blocked.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
renamed from :meth:`isBlocked` method
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
can also detect range blocks.
:param force: if True, forces reloading the data from API
@@ -162,7 +162,7 @@
def is_locked(self, force: bool = False) -> bool:
"""Determine whether the user is currently locked globally.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:param force: if True, forces reloading the data from API
"""
@@ -409,7 +409,7 @@
) -> Generator[tuple[Page, Revision]]:
"""Yield tuples describing this user's deleted edits.
- .. version-added:: 5.5
+ .. versionadded:: 5.5
:param total: Limit results to this number of pages
:keyword start: Iterate contributions starting at this Timestamp
@@ -477,7 +477,7 @@
* :meth:`BasePage.moved_target`
* :meth:`BasePage.getRedirectTarget`
- .. version-added:: 9.4
+ .. versionadded:: 9.4
:raises NoRenameTargetError: user was not renamed
"""
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index ce8b3b2..5da0ea6 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -299,7 +299,7 @@
.. seealso:: :meth:`WikibasePage.editEntity`
- .. version-changed:: 8.0.1
+ .. versionchanged:: 8.0.1
Copy snak IDs/hashes (:phab:`T327607`)
:param data: Data to be saved
@@ -372,7 +372,7 @@
"""Interface for MediaInfo entities on Commons.
- .. version-added:: 6.5
+ .. versionadded:: 6.5
"""
entity_type = 'mediainfo'
@@ -407,7 +407,7 @@
def _defined_by(self, singular: bool = False) -> dict:
"""Function to provide the API parameters to identify the entity.
- .. version-added:: 8.5
+ .. versionadded:: 8.5
:param singular: Whether the parameter names should use the singular
form
@@ -452,7 +452,7 @@
of this entity and their modifying may indirectly cause
unwanted change to the live content
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Added *pageid*, *ns*, *title*, *lastrevid*, *modified*, *id*
values to ``_content`` attribute when it is loaded.
@@ -521,7 +521,7 @@
def title(self) -> str:
"""Return ID as title of the MediaInfo.
- .. version-added:: 9.4
+ .. versionadded:: 9.4
.. seealso:: :meth:`getID`
:raises NoWikibaseEntityError: if this entity is associated with
@@ -544,7 +544,7 @@
>>> item = page.data_item()
>>> item.editLabels({'en': 'Test file.'}) # doctest: +SKIP
- .. version-added:: 8.5
+ .. versionadded:: 8.5
"""
data = {'labels': labels}
self.editEntity(data, **kwargs)
@@ -552,7 +552,7 @@
def addClaim(self, claim, bot: bool = True, **kwargs) -> None:
"""Add a claim to the MediaInfo.
- .. version-added:: 8.5
+ .. versionadded:: 8.5
:param claim: The claim to add
:type claim: pywikibot.page.Claim
@@ -569,7 +569,7 @@
def removeClaims(self, claims, **kwargs) -> None:
"""Remove the claims from the MediaInfo.
- .. version-added:: 8.5
+ .. versionadded:: 8.5
:param claims: list of claims to be removed
:type claims: list or pywikibot.Claim
@@ -1168,7 +1168,7 @@
def getRedirectTarget(self, *, ignore_section: bool = True):
"""Return the redirect target for this page.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
*ignore_section* parameter
.. seealso:: :meth:`page.BasePage.getRedirectTarget`
@@ -1217,7 +1217,7 @@
If the item doesn't have a link to that site, raise
NoSiteLinkError.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
raises NoSiteLinkError instead of NoPageError.
:param site: Site to find the linked page of.
@@ -1309,7 +1309,7 @@
You need to define an extra argument to make this work, like
:code:`save=True`.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
*botflag* keyword parameter was renamed to *bot*.
:param target_page: target of the redirect, this argument is
@@ -1349,7 +1349,7 @@
Return the first 'preferred' ranked Claim specified by Wikibase
property or the first 'normal' one otherwise.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
.. seealso:: :meth:`pywikibot.Page.get_best_claim`
@@ -1385,7 +1385,7 @@
) -> pywikibot.WbRepresentation | None:
"""Return the best value for this page at a given timestamp.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
:param prop: property id, "P###"
:param timestamp: the timestamp to check the value at
@@ -1514,7 +1514,7 @@
def exists(self) -> bool:
"""Determine if the property exists in the data repository.
- .. version-added:: 9.4
+ .. versionadded:: 9.4
"""
try:
self._type = self.repo.get_property_type(self)
@@ -1527,7 +1527,7 @@
def type(self) -> str:
"""Return the type of this property.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
raises :exc:`NoWikibaseEntityError` if property does not
exist.
@@ -1824,7 +1824,7 @@
def fromJSON(cls, site, data: dict[str, Any]) -> Claim:
"""Create a claim object from JSON returned in the API call.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
print a warning if the Claim.type is not given and missing in
the wikibase.
@@ -2242,7 +2242,7 @@
def has_better_rank(self, other: Claim | None) -> bool:
"""Check if this claim has a better rank than the other claim.
- .. version-added:: 10.6
+ .. versionadded:: 10.6
:param other: The other claim to compare with.
:return: True if this claim has a better rank, False otherwise.
diff --git a/pywikibot/pagegenerators/__init__.py b/pywikibot/pagegenerators/__init__.py
index d5c1924..a56492d 100644
--- a/pywikibot/pagegenerators/__init__.py
+++ b/pywikibot/pagegenerators/__init__.py
@@ -213,7 +213,7 @@
logevent,username,start,end
- .. version-deprecated:: 9.2
+ .. deprecated:: 9.2
backward compatible *total* argument like
``logevent,username,total``; use ``-limit`` filter
option instead (see below).
diff --git a/pywikibot/pagegenerators/_factory.py b/pywikibot/pagegenerators/_factory.py
index e66df92..83ff73c 100644
--- a/pywikibot/pagegenerators/_factory.py
+++ b/pywikibot/pagegenerators/_factory.py
@@ -132,7 +132,7 @@
Otherwise the value is undefined and gives None.
- .. version-added:: 7.3
+ .. versionadded:: 7.3
"""
def _validate_options(self,
@@ -203,9 +203,9 @@
Only call this after all arguments have been parsed.
- .. version-changed:: 7.3
+ .. versionchanged:: 7.3
set the instance variable :attr:`is_preloading` to True or False.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
if ``limit`` option is set and multiple generators are given,
pages are yieded in a :func:`roundrobin
<tools.itertools.roundrobin_generators>` way.
@@ -373,7 +373,7 @@
) -> Iterable[pywikibot.page.BasePage] | None:
"""Parse the -logevent argument information.
- .. version-deprecated:: 9.2
+ .. deprecated:: 9.2
the *start* parameter as total amount of pages.
:param logtype: A valid logtype
@@ -928,7 +928,7 @@
def _handle_redirect(self, value: str) -> Literal[True]:
"""Handle `-redirect` argument.
- .. version-added:: 8.5
+ .. versionadded:: 8.5
"""
if not value:
# True by default
@@ -939,7 +939,7 @@
def _handle_pagepile(self, value: str) -> HANDLER_GEN_TYPE:
"""Handle `-pagepile` argument.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
if not value.isnumeric():
raise ValueError(
@@ -949,8 +949,8 @@
def handle_args(self, args: Iterable[str]) -> list[str]:
"""Handle command line arguments and return the rest as a list.
- .. version-added:: 6.0
- .. version-changed:: 7.3
+ .. versionadded:: 6.0
+ .. versionchanged:: 7.3
Prioritize -namespaces options to solve problems with several
generators like -newpages/-random/-randomredirect/-linter
"""
@@ -969,7 +969,7 @@
can try parsing the argument. Call getCombinedGenerator() after all
arguments have been parsed to get the final output generator.
- .. version-added:: 6.0
+ .. versionadded:: 6.0
renamed from ``handleArg``
:param arg: Pywikibot argument consisting of -name:value
diff --git a/pywikibot/pagegenerators/_generators.py b/pywikibot/pagegenerators/_generators.py
index 256a9ae..6286bca 100644
--- a/pywikibot/pagegenerators/_generators.py
+++ b/pywikibot/pagegenerators/_generators.py
@@ -52,7 +52,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Iterate Page objects for all titles in a single namespace.
- .. version-deprecated:: 10.0
+ .. deprecated:: 10.0
The *includeredirects* parameter; use *filterredir* instead.
.. seealso:: :meth:`APISite.allpages()
<pywikibot.site._generators.GeneratorsMixin.allpages>`
@@ -112,7 +112,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Prefixed Page generator.
- .. version-deprecated:: 10.0
+ .. deprecated:: 10.0
The *includeredirects* parameter; use *filterredir* instead.
:param prefix: The prefix of the pages.
@@ -225,13 +225,13 @@
For keyword parameters refer :meth:`APISite.recentchanges()
<pywikibot.site._generators.GeneratorsMixin.recentchanges>`.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
The YieldType depends on namespace. It can be
:class:`pywikibot.Page<pywikibot.page.Page>`,
:class:`pywikibot.User<pywikibot.page.User>`,
:class:`pywikibot.FilePage<pywikibot.page.FilePage>` or
:class:`pywikibot.Category<pywikibot.page.Category>`.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
Ignore :class:`pywikibot.FilePage<pywikibot.page.FilePage>` if it
raises a :exc:`ValueError` during upcast e.g. due to an invalid
file extension.
@@ -282,7 +282,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Iterate Page objects for all unconnected pages to a Wikibase repository.
- .. version-changed::
+ .. versionchanged::
The *strict* parameter was added.
:param site: Site for generator results.
@@ -820,7 +820,7 @@
) -> Iterable[pywikibot.page.Page]:
r"""Yield pages from the MediaWiki internal search engine.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
Keyword arguments *content*, *sort* and *where* was added.
.. seealso:: :meth:`site.search()
@@ -884,9 +884,9 @@
generator prints a warning for each query.
.. seealso:: https://policies.google.com/terms
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
``googlesearch-python`` package is needed instead of ``google``,
see :phab:`T387618` for further informations. The *total*
parameter was added. The *query* parameter is positional only.
@@ -933,7 +933,7 @@
.. important:: These note are from 2014 and have not been
reviewed or updated since then.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
*query* is positional only; *kwargs* parameter was added.
:param query: the text to search for.
@@ -957,9 +957,9 @@
def generator(self) -> Generator[pywikibot.page.Page]:
"""Yield results from :meth:`queryGoogle` query.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
changed from iterator method to generator property
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
use :meth:`site.protocol
<pywikibot.site._basesite.BaseSite.protocol>` to get the base
URL. Also filter duplicates.
@@ -994,7 +994,7 @@
:class:`pagegenerators.GeneratorFactory` to circumvent call of
:func:`itertools.islice` filter for this generator.
- .. version-added:: 10.1
+ .. versionadded:: 10.1
"""
self.limit = value
@@ -1087,7 +1087,7 @@
FROM page
LIMIT 10
- .. version-added:: 9.2
+ .. versionadded:: 9.2
:param query: the SQL query string.
:param site: Site for generator results.
@@ -1163,7 +1163,7 @@
"""Xml iterator that yields Page objects.
- .. version-added:: 7.2
+ .. versionadded:: 7.2
the `content` parameter
:param filename: filename of XML dump
@@ -1351,8 +1351,8 @@
"""Queries PetScan to generate pages.
.. seealso:: https://petscan.wmflabs.org/
- .. version-added:: 3.0
- .. version-changed:: 7.6
+ .. versionadded:: 3.0
+ .. versionchanged:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -1421,7 +1421,7 @@
def query(self) -> Generator[dict[str, Any]]:
"""Query PetScan.
- .. version-changed:: 7.4
+ .. versionchanged:: 7.4
raises :class:`APIError` if query returns an error message.
:raises ServerError: Either ReadTimeout or server status error
@@ -1450,7 +1450,7 @@
def generator(self) -> Generator[pywikibot.page.Page]:
"""Yield results from :meth:`query`.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
changed from iterator method to generator property
"""
for raw_page in self.query():
@@ -1463,7 +1463,7 @@
"""Queries PagePile to generate pages.
.. seealso:: https://pagepile.toolforge.org/
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
def __init__(self, id: int) -> None:
diff --git a/pywikibot/plural.py b/pywikibot/plural.py
index dff26f1..081a454 100644
--- a/pywikibot/plural.py
+++ b/pywikibot/plural.py
@@ -114,6 +114,6 @@
def plural_rule(lang: str) -> PluralRule:
"""Return the plural rule for a given lang.
- .. version-added:: 4.3
+ .. versionadded:: 4.3
"""
return plural_rules.get(lang, plural_rules['_default'])
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index ab8c360..5a9fd4d 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -122,7 +122,7 @@
>>> a.value
'A123'
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
def __init__(self, attr, value) -> None:
@@ -168,7 +168,7 @@
"""A descriptor tag.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
def __init__(self) -> None:
@@ -253,8 +253,8 @@
>>> 'step' in tp
False
- .. version-added:: 8.0
- .. version-changed:: 8.1
+ .. versionadded:: 8.0
+ .. versionchanged:: 8.1
*text* parameter is defaulted to ``'<pages />'``.
"""
@@ -801,7 +801,7 @@
def _url_image_lt_140(self) -> str:
"""Get the file url of the scan of ProofreadPage.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
:return: file url of the scan ProofreadPage or None.
@@ -838,7 +838,7 @@
def _url_image_ge_140(self) -> str:
"""Get the file url of the scan of ProofreadPage.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
:return: file url of the scan of ProofreadPage or None.
:raises ValueError: in case of no image found for scan
@@ -969,9 +969,9 @@
.. warning:: It is the user's responsibility to reset quality
level accordingly.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
default for *ocr_tool* is `wmfOCR`.
- .. version-removed:: 9.2
+ .. versionremoved:: 9.2
`phetools` support is not available anymore.
:param ocr_tool: 'wmfOCR' or 'googleOCR'; default is 'wmfOCR'
@@ -1258,7 +1258,7 @@
Range is [start ... end], extremes included.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
The *content* parameter was removed
:param start: first page, defaults to 1
diff --git a/pywikibot/scripts/__init__.py b/pywikibot/scripts/__init__.py
index ce11239..415cf12 100644
--- a/pywikibot/scripts/__init__.py
+++ b/pywikibot/scripts/__init__.py
@@ -1,7 +1,7 @@
"""Folder which holds framework scripts.
-.. version-added:: 7.0
-.. version-removed:: 9.4
+.. versionadded:: 7.0
+.. versionremoved:: 9.4
``preload_sites`` script, previously added in release 6.0
(:phab:`T226157`), was removed (:phab:`T348925`).
"""
@@ -18,8 +18,8 @@
def _import_with_no_user_config(*import_args):
"""Return ``__import__(*import_args)`` without loading user config.
- .. version-added:: 3.0
- .. version-changed:: 7.0
+ .. versionadded:: 3.0
+ .. versionchanged:: 7.0
moved to pywikibot.scripts
"""
orig_no_user_config = getenv('PYWIKIBOT_NO_USER_CONFIG')
diff --git a/pywikibot/scripts/generate_family_file.py b/pywikibot/scripts/generate_family_file.py
index 80b7e5c..72c7d2c 100755
--- a/pywikibot/scripts/generate_family_file.py
+++ b/pywikibot/scripts/generate_family_file.py
@@ -22,13 +22,13 @@
This will create the file mywiki_family.py in families folder of your
base directory.
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
moved to pywikibot.scripts folder; create family files in families
folder of your base directory instead of pywikibot/families.
-.. version-changed:: 8.1
+.. versionchanged:: 8.1
[s]trict can be given for <dointerwiki> parameter to ensure that
sites are from the given domain.
-.. version-changed:: 8.4
+.. versionchanged:: 8.4
If the url scheme is missing, ``https`` will be used.
"""
#
@@ -171,7 +171,7 @@
def getlangs(self, w) -> None:
"""Determine site code of a family.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
with [e]dit the interwiki list can be given delimited by
space or comma or both. With [s]trict only sites with the
same domain are collected. A [h]elp answer was added to show
diff --git a/pywikibot/scripts/generate_user_files.py b/pywikibot/scripts/generate_user_files.py
index 019d05d..9bc7268 100755
--- a/pywikibot/scripts/generate_user_files.py
+++ b/pywikibot/scripts/generate_user_files.py
@@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""Script to create user-config.py. Other file names are not supported.
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
moved to pywikibot.scripts folder.
-.. version-changed:: 8.0
+.. versionchanged:: 8.0
let user the choice which section to be copied.
Also EXTERNAL EDITOR SETTINGS section can be copied.
-.. version-changed:: 10.7.1
+.. versionchanged:: 10.7.1
Default ``PASS_BASENAME`` was changed from ``user-password.py`` to
``user-password.cfg``
"""
@@ -265,7 +265,7 @@
def copy_sections(force: bool = False, default: str = 'n') -> str | None:
"""Take config sections and copy them to user-config.py.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*force* and *default* options were added.
:param force: Copy all sections if force is True
@@ -299,7 +299,7 @@
default: str = 'n') -> list[str]:
"""Ask for settings to copy.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
:param variant: Variant of the setting section. Either 'framework'
or 'scripts'
diff --git a/pywikibot/scripts/login.py b/pywikibot/scripts/login.py
index b3656fc..74c1583 100755
--- a/pywikibot/scripts/login.py
+++ b/pywikibot/scripts/login.py
@@ -42,13 +42,13 @@
To log out, throw away the ``*.lwp`` file that is created in the data
subdirectory.
-.. version-changed:: 7.4
+.. versionchanged:: 7.4
moved to :mod:`pywikibot.scripts` folder.
-.. version-changed:: 7.7
+.. versionchanged:: 7.7
*-async* option was added.
-.. version-changed:: 10.2
+.. versionchanged:: 10.2
wildcard site codes in ``usernames`` dict are supported.
-.. version-changed:: 10.3
+.. versionchanged:: 10.3
the -cookies option
"""
#
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index 08bb12b..487bcab 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -13,7 +13,7 @@
python pwb.py shell [args]
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
moved to pywikibot.scripts
"""
# (C) Pywikibot team, 2014-2025
@@ -29,7 +29,7 @@
def main(*args: str) -> None:
"""Script entry point.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*exitmsg* was added for :func:`code.interact`.
"""
args = list(args)
diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py
index a1196ce..661432b 100755
--- a/pywikibot/scripts/version.py
+++ b/pywikibot/scripts/version.py
@@ -6,11 +6,11 @@
-nouser do not print usernames; otherwise they are printed for each
registered family
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
version script was moved to the framework scripts folder.
-.. version-added:: 9.1.2
+.. versionadded:: 9.1.2
the *-nouser* option was added.
-.. version-changed:: 10.6
+.. versionchanged:: 10.6
The User-Agent string is now printed for the default site. To print
it for another site, call the ``pwb`` wrapper with the global option,
e.g.:
@@ -76,7 +76,7 @@
def main(*args: str) -> None:
"""Print pywikibot version and important settings.
- .. version-changed:: 9.1.2
+ .. versionchanged:: 9.1.2
usernames are not printed with ``-nouser`` option.
"""
pywikibot.info('Pywikibot: ' + getversion())
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index aa95efd..906c8a1 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -32,14 +32,14 @@
python pwb.py -lang:de bot_tests -v
.. seealso:: :mod:`pwb` entry point
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
pwb wrapper was added to the Python site package lib.
-.. version-changed:: 7.7
+.. versionchanged:: 7.7
pwb wrapper is able to set ``PYWIKIBOT_TEST_...`` environment variables,
see :ref:`Environment variables`.
-.. version-changed:: 8.0
+.. versionchanged:: 8.0
renamed to wrapper.py.
-.. version-changed:: 9.4
+.. versionchanged:: 9.4
enable external scripts via entry points.
"""
#
@@ -116,7 +116,7 @@
def run_python_file(filename: str, args: list[str], package=None) -> None:
"""Run a python file as if it were the main program on the command line.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
Set and restore ``PYWIKIBOT_TEST_...`` environment variables.
:param filename: The path to the file to execute, it need not be a
@@ -178,7 +178,7 @@
) -> tuple[str, list[str], list[str], list[str]]:
"""Handle args and get filename.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
Catch ``PYWIKIBOT_TEST_...`` environment variables.
:return: filename, script args, local pwb args, environment variables
@@ -391,11 +391,11 @@
def find_filename(filename):
"""Search for the filename in the given script paths.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
Search users_scripts_paths in config.base_dir
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Add config.base_dir to search path
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
Search in entry point paths
"""
from pywikibot import config
@@ -474,7 +474,7 @@
def execute() -> bool:
"""Parse arguments, extract filename and run the script.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
renamed from :func:`main`
"""
global filename
@@ -541,7 +541,7 @@
def main() -> None:
"""Script entry point. Print doc if necessary.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
previous implementation was renamed to :func:`execute`
"""
if not check_modules():
@@ -554,7 +554,7 @@
def run() -> None: # pragma: no cover
"""Site package entry point. Print doc if necessary.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
global site_package
site_package = True
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index eb8c4a1..8664488 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -200,7 +200,7 @@
) -> BaseSite:
"""Create a site from a database name using the sitematrix.
- .. version-changed:: 8.3.3
+ .. versionchanged:: 8.3.3
changed from classmethod to staticmethod.
:param dbname: database name
@@ -305,7 +305,7 @@
def simple_request(self, **kwargs: Any) -> api.Request:
"""Create a request by defining all kwargs as parameters.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
`_simple_request` becomes a public method
"""
return self._request_class({'parameters': kwargs}).create_simple(
@@ -342,9 +342,9 @@
) -> None:
"""Log the user in if not already logged in.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
lazy load cookies when logging in. This was dropped in 8.0.4
- .. version-changed:: 8.0.4
+ .. versionchanged:: 8.0.4
the *cookie_only* parameter was added and cookies are loaded
whenever the site is initialized.
@@ -487,8 +487,8 @@
def file_extensions(self) -> list[str]:
"""File extensions enabled on the wiki.
- .. version-added:: 8.4
- .. version-changed:: 9.2
+ .. versionadded:: 8.4
+ .. versionchanged:: 9.2
also include extensions from the image repository
"""
ext = self.siteinfo.get('fileextensions')
@@ -500,7 +500,7 @@
def maxlimit(self) -> int:
"""Get the maximum limit of pages to be retrieved.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
parameter = self._paraminfo.parameter('query+info', 'prop')
assert parameter is not None
@@ -587,7 +587,7 @@
.. seealso::
- :class:`tools.collections.RateLimit` for RateLimit examples.
- :api:`Ratelimit`
- .. version-added:: 9.0
+ .. versionadded:: 9.0
:param action: action which might be limited
:return: RateLimit tuple with ``group``, ``hits`` and ``seconds``
@@ -648,7 +648,7 @@
- :meth:`logged_in` to verify the user is loggend in to a site
.. seealso:: :api:`Userinfo`
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Use API formatversion 2.
:return: A dict with the following keys and values:
@@ -683,7 +683,7 @@
def userinfo(self) -> None:
"""Delete cached userinfo.
- .. version-added:: 5.5
+ .. versionadded:: 5.5
"""
if hasattr(self, '_userinfo'):
del self._userinfo
@@ -693,7 +693,7 @@
force: bool = False) -> dict[str, Any]:
"""Retrieve globaluserinfo from site and cache it.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:param user: The user name or user ID whose global info is
retrieved. Defaults to the current user.
@@ -747,7 +747,7 @@
To get globaluserinfo for a given user or user ID use
:meth:`get_globaluserinfo` method instead
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
return self.get_globaluserinfo()
@@ -755,7 +755,7 @@
def globaluserinfo(self) -> None:
"""Delete cached globaluserinfo of current user.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
username = self.username()
assert username is not None
@@ -770,7 +770,7 @@
.. seealso:: :api:`Userinfo`
- .. version-added:: 7.0
+ .. versionadded:: 7.0
The `force` parameter
:param force: Whether the cache should be discarded.
@@ -784,7 +784,7 @@
force: bool = False) -> bool:
"""Return True when given user is locked globally.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:param user: The user name or user ID. Defaults to the current
user.
@@ -832,9 +832,9 @@
Replaces the ``$1`` placeholder from MediaWiki with a
Python-compatible ``{}``.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
raises ValueError instead of AttributeError if "$1"
placeholder is missing.
@@ -853,7 +853,7 @@
Letters that can follow a wikilink and are regarded as part of
this link. This depends on the linktrail setting in LanguageXx.php
- .. version-added:: 7.3
+ .. versionadded:: 7.3
:return: The linktrail regex.
"""
@@ -1155,7 +1155,7 @@
:meth:`BaseSite.redirects()
<pywikibot.site._basesite.BaseSite.redirects>`
- .. version-added:: 8.4
+ .. versionadded:: 8.4
"""
return [s.lstrip('#') for s in self.getmagicwords('redirect')]
@@ -1357,7 +1357,7 @@
>>> page is None
True
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
No longer raise NotimplementedError if used with a Wikibase
site.
@@ -1398,7 +1398,7 @@
If optional argument *all_ns* is true, return all recognized
values for this namespace.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*all* parameter was renamed to *all_ns*.
:param num: Namespace constant.
@@ -1490,9 +1490,9 @@
.. note:: Parameters validation and error handling left to the
API call.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*mediatype* and *bitdepth* properties were added.
- .. version-changed:: 8.6.
+ .. versionchanged:: 8.6.
Added *timestamp* parameter.
Metadata are loaded only if *history* is False.
.. seealso:: :api:`Imageinfo`
@@ -1588,7 +1588,7 @@
) -> pywikibot.page.Page:
"""Return page object for the redirect target of page.
- .. version-added:: 9.3
+ .. versionadded:: 9.3
*ignore_section* parameter
.. seealso:: :meth:`page.BasePage.getRedirectTarget`
@@ -1719,10 +1719,10 @@
You should not call this method directly, especially if you only
need a specific token. Use :attr:`tokens` property instead.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*all* parameter is deprecated. Use an empty list for
``types`` instead.
- .. version-changed:: 11.0
+ .. versionchanged:: 11.0
*all* parameter was removed.
.. seealso:: :api:`Tokens`
@@ -1780,7 +1780,7 @@
'1c8...9d3+\\'
>>> del site.tokens # another variant to clear the cache
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
``tokens`` attribute became a property to enable deleter.
.. warning:: A deprecation warning is shown if the token name is
outdated, see :api:`Tokens (action)`.
@@ -1797,7 +1797,7 @@
def get_parsed_page(self, page: BasePage) -> str:
"""Retrieve parsed text of the page using action=parse.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
raises KeyError instead of AssertionError
.. seealso::
@@ -1865,7 +1865,7 @@
If more than one target id is provided, the same action is taken for
all of them.
- .. version-added:: 6.0
+ .. versionadded:: 6.0
:param targettype: Type of target. One of "archive", "filearchive",
"logging", "oldimage", "revision".
@@ -2385,7 +2385,7 @@
.. seealso:: :api:`Move`
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
The `movesubpages` parameter was added
:param page: the Page to be moved (must exist)
@@ -2496,7 +2496,7 @@
will revert the last edit(s) made by the specified user on the
given page.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
Added *pageid* as alternative to *page* (one must be given).
*markbot* defaults to True if the rollbacker is a bot and not
explicitly given. The method now returns a dictionary with
@@ -2628,16 +2628,16 @@
To delete a specific version of an image the oldimage identifier
must be provided.
- .. version-added:: 6.1
+ .. versionadded:: 6.1
renamed from `deletepage`
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
keyword only parameter `oldimage` was added.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
keyword only parameter `deletetalk` was added.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
raises :exc:`exceptions.NoPageError` if page does not exist.
:param page: Page to be deleted or its pageid.
@@ -2717,10 +2717,10 @@
.. seealso:: :api:`Undelete`
- .. version-added:: 6.1
+ .. versionadded:: 6.1
renamed from `undelete_page`
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
`fileids` parameter was added,
keyword argument required for `revisions`.
@@ -2770,7 +2770,7 @@
>>> sorted(site.protection_types())
['create', 'edit', 'move', 'upload']
- .. version-deprecated:: 10.5
+ .. deprecated:: 10.5
Use :attr:`restrictions[types]<restrictions>` instead.
:return: protection types available
@@ -2787,7 +2787,7 @@
>>> sorted(site.protection_levels())
['', 'autoconfirmed', ... 'sysop', 'templateeditor']
- .. version-deprecated:: 10.5
+ .. deprecated:: 10.5
Use :attr:`restrictions[levels]<restrictions>` instead.
:return: protection levels available
@@ -2807,7 +2807,7 @@
>>> sorted(r['levels'])
['', 'autoconfirmed', ... 'sysop', 'templateeditor']
- .. version-added:: 10.5
+ .. versionadded:: 10.5
.. seealso:: :meth:`page_restrictions`
:return: dict with keys 'types', 'levels', 'cascadinglevels' and
@@ -2978,7 +2978,7 @@
) -> bool:
"""Add or remove pages from watchlist.
- .. version-changed:: 10.4.0
+ .. versionchanged:: 10.4.0
Added the *expiry* parameter to specify watch expiry time.
Passing *unwatch* as a positional parameter is deprecated;
it must be passed as keyword argument.
@@ -3122,10 +3122,10 @@
Either source_filename or source_url, but not both, must be provided.
- .. version-changed:: 6.0
+ .. versionchanged:: 6.0
keyword arguments required for all parameters except `filepage`
- .. version-changed:: 6.2:
+ .. versionchanged:: 6.2:
asynchronous upload is used if `asynchronous` parameter is set.
For keyword arguments refer :class:`pywikibot.site._upload.Uploader`
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py
index caa3e55..24bdcbe 100644
--- a/pywikibot/site/_basesite.py
+++ b/pywikibot/site/_basesite.py
@@ -185,7 +185,7 @@
def __getattr__(self, name: str):
"""Delegate undefined methods calls to the Family object.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Only delegate to public Family methods which have ``code`` as
first parameter.
"""
@@ -225,7 +225,7 @@
def languages(self) -> list[str]:
"""Return list of all valid site codes for this site's Family.
- .. version-deprecated:: 9.6
+ .. deprecated:: 9.6
Use :meth:`codes` instead.
"""
return sorted(self.codes)
@@ -234,7 +234,7 @@
def codes(self) -> set[str]:
"""Return set of all valid site codes for this site's Family.
- .. version-added:: 9.6
+ .. versionadded:: 9.6
.. seealso:: :attr:`family.Family.codes`
"""
return set(self.family.langs.keys())
@@ -274,7 +274,7 @@
def redirect(self) -> str:
"""Return a default redirect tag for the site.
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
return a single generic redirect tag instead of a list of
tags. For the list use :meth:`redirects` instead.
"""
@@ -284,7 +284,7 @@
"""Return list of generic redirect tags for the site.
.. seealso:: :meth:`redirect` for the default redirect tag.
- .. version-added:: 8.4
+ .. versionadded:: 8.4
"""
return ['REDIRECT']
@@ -375,7 +375,7 @@
arbitrary stuff, then a wikilink. The wikilink may contain a
label, although this is not useful.
- .. version-added:: 8.4
+ .. versionadded:: 8.4
moved from class:`APISite<pywikibot.site._apisite.APISite>`
"""
tags = '|'.join(self.redirects())
diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py
index 8e86078b..6cb87db 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -58,7 +58,7 @@
support that entity type either.
.. seealso:: https://www.mediawiki.org/wiki/Wikibase/Federation
- .. version-added:: 8.0
+ .. versionadded:: 8.0
:raises ValueError: when invalid entity type was provided
"""
@@ -244,7 +244,7 @@
This is used specifically because we can cache the value for a
much longer time (near infinite).
- .. version-added:: 9.5
+ .. versionadded:: 9.5
:raises NoWikibaseEntityError: *prop* does not exist
"""
@@ -274,7 +274,7 @@
def getPropertyType(self, prop):
"""Obtain the type of a property.
- .. version-deprecated:: 9.5
+ .. deprecated:: 9.5
Use :meth:`get_property_type` instead.
"""
try:
@@ -294,7 +294,7 @@
``item`` if dict with API parameters was passed to *entity*
parameter.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* keyword argument was added
:param entity: Page to edit, or dict with API parameters
@@ -360,7 +360,7 @@
tags: str | None = None) -> None:
"""Add a claim.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
:param entity: Entity to modify
@@ -397,7 +397,7 @@
tags: str | None = None):
"""Set the claim target to the value of the provided claim target.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
:param claim: The source of the claim target value
@@ -439,7 +439,7 @@
tags: str | None = None):
"""Save the whole claim to the wikibase site.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
:param claim: The claim to save
@@ -482,9 +482,9 @@
tags: str | None = None):
"""Create/Edit a source.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
deprecated *baserevid* parameter was removed
:param claim: A Claim object to add the source to.
@@ -542,9 +542,9 @@
tags: str | None = None):
"""Create/Edit a qualifier.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
deprecated *baserevid* parameter was removed
:param claim: A Claim object to add the qualifier to
@@ -591,9 +591,9 @@
tags: str | None = None):
"""Remove claims.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
deprecated *baserevid* parameter was removed
:param claims: Claims to be removed
@@ -628,9 +628,9 @@
tags: str | None = None):
"""Remove sources.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
deprecated `baserevid` parameter was removed
:param claim: A Claim object to remove the sources from
@@ -662,9 +662,9 @@
tags: str | None = None):
"""Remove qualifiers.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
deprecated `baserevid` parameter was removed
:param claim: A Claim object to remove the qualifier from
@@ -694,7 +694,7 @@
bot: bool = True) -> dict:
"""Link two pages together.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
:param page1: First page to link
@@ -725,7 +725,7 @@
tags: str | None = None) -> dict:
"""Merge two items together.
- .. version-changed:: 9.4
+ .. versionchanged:: 9.4
*tags* parameter was added
:param from_item: Item to merge from
@@ -836,7 +836,7 @@
validate: bool = False) -> list[Any]:
"""Send data values to the wikibase parser for interpretation.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
.. seealso:: `wbparsevalue API
<https://www.wikidata.org/w/api.php?action=help&modules=wbparsevalue>`_
diff --git a/pywikibot/site/_extensions.py b/pywikibot/site/_extensions.py
index cca170d..2e24b85 100644
--- a/pywikibot/site/_extensions.py
+++ b/pywikibot/site/_extensions.py
@@ -183,7 +183,7 @@
Load URLs to images for a given page in the "Page:" namespace.
No effect for pages in other namespaces.
- .. version-added:: 8.6
+ .. versionadded:: 8.6
.. seealso:: :api:`imageforpage`
"""
@@ -302,7 +302,7 @@
.. warning:: The retrieved pages may be connected in meantime.
To avoid this, use *strict* parameter to check.
- .. version-changed::
+ .. versionchanged::
The *strict* parameter was added.
:param total: Maximum number of pages to return, or ``None`` for
@@ -435,7 +435,7 @@
"""APISite mixin for TextExtracts extension.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
"""
@need_extension('TextExtracts')
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index 599b192..8b15ad1 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -134,11 +134,11 @@
pagelist. In case of duplicates in a groupsize batch, return the
first entry.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
*content* parameter was added.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
*categories* parameter was added.
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
*groupsize* is maxlimit by default. *quiet* parameter was
added. No longer show the "Retrieving pages from site"
message by default.
@@ -354,7 +354,7 @@
.. seealso:: :api:`Redirects`
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:param page: The Page to get redirects for.
:param filter_fragments: If True, only return redirects with fragments.
@@ -459,7 +459,7 @@
) -> Iterable[pywikibot.Page]:
"""Iterate categories to which page belongs.
- .. version-added:: 9.6
+ .. versionadded:: 9.6
the *with_sort_key* parameter.
.. seealso::
@@ -581,9 +581,9 @@
- :meth:`pywikibot.Category.members`
- :meth:`pywikibot.Category.subcategories`
- .. version-changed:: 4.0
+ .. versionchanged:: 4.0
parameters except *category* are keyword arguments only.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
raises TypeError instead of Error if no Category is specified
.. seealso:: :api:`Categorymembers`
@@ -874,7 +874,7 @@
) -> Generator[pywikibot.Link]:
"""Yield all interlanguage links on page, yielding Link objects.
- .. version-changed:: 6.2:
+ .. versionchanged:: 6.2:
`include_empty_titles` parameter was added.
.. seealso:: :api:`Langlinks`
@@ -1291,7 +1291,7 @@
"""Iterate Pages that contain links to the given FilePage.
.. seealso:: :api:`Imageusage`
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
all parameters except `image` are keyword only.
:param image: the image to search for (FilePage need not exist on
@@ -1400,7 +1400,7 @@
) -> Iterable[dict[str, Any]]:
"""Iterate recent changes.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
*page* parameter was added.
.. seealso:: :api:`RecentChanges`
@@ -1492,13 +1492,13 @@
Note that this may include non-existing Pages if the wiki's
database table contains outdated entries.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
Default of `where` parameter has been changed from 'text' to
None. The behaviour depends on the installed search engine
which is 'text' on CirrusSearch'.
raises APIError instead of Error if searchstring is not set
or what parameter is wrong.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
The *sort* parameter was added.
.. seealso:: :api:`Search`
@@ -1833,7 +1833,7 @@
random.
.. seealso:: :api:`Random`
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Raises ``TypeError`` instead of ``AssertionError`` if
*redirects* is invalid.
@@ -2022,7 +2022,7 @@
API.
.. seealso:: :api:`Querypage`
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Raises ``ValueError`` instead of ``AssertionError`` if
*special_page* is invalid.
@@ -2274,7 +2274,7 @@
:py:obj:`APISite.allpages`, while it uses for 'create' the
'query+protectedtitles' module.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*type* parameter was renamed to *protect_type*.
.. seealso:: :api:`Protectedtitles`
@@ -2330,7 +2330,7 @@
.. note:: ``watched_pages`` is a restartable generator. See
:class:`tools.collections.GeneratorWrapper` for its usage.
.. seealso:: :api:`Watchlistraw`
- .. version-added:: 8.1
+ .. versionadded:: 8.1
the *with_talkpage* parameter.
:param force: Reload watchlist
diff --git a/pywikibot/site/_namespace.py b/pywikibot/site/_namespace.py
index 1f96864..d31b4d2 100644
--- a/pywikibot/site/_namespace.py
+++ b/pywikibot/site/_namespace.py
@@ -49,7 +49,7 @@
def canonical(self) -> str:
"""Canonical form of MediaWiki built-in namespace.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
"""
name = '' if self == 0 else self.name.capitalize().replace('_', ' ')
return name.replace('Mediawiki', 'MediaWiki')
@@ -59,7 +59,7 @@
"""Metaclass for Namespace attribute settings.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
def __new__(cls, name, bases, dic):
@@ -86,7 +86,7 @@
If only one of canonical_name and custom_name are available, both
properties will have the same value.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
metaclass from :class:`MetaNamespace`
"""
@@ -149,7 +149,7 @@
def canonical_namespaces(cls) -> dict[int, str]:
"""Return the canonical forms of MediaWiki built-in namespaces.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
implemented as classproperty using BuiltinNamespace IntEnum.
"""
return {item.value: item.canonical for item in BuiltinNamespace}
@@ -188,7 +188,7 @@
This method is implemented to be independent from __len__ method.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
:return: Always return True like generic object class.
"""
diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py
index 3a4f4fe..b428850 100644
--- a/pywikibot/site/_siteinfo.py
+++ b/pywikibot/site/_siteinfo.py
@@ -32,7 +32,7 @@
All values of the 'general' property are directly available.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
formatversion 2 is used for API calls.
.. admonition:: Compatibility note
@@ -50,7 +50,7 @@
:code:`'thumblimits': [120, 150, 180, 200, 220, 250, 300, 400]`
- .. version-deprecated:: 10.5
+ .. deprecated:: 10.5
Accessing the fallback '*' keys in 'languages', 'namespaces',
'namespacealiases', and 'skins' properties are deprecated and
will be removed in a future release of Pywikibot.
@@ -70,7 +70,7 @@
def clear(self) -> None:
"""Clear all cached siteinfo properties.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
"""
self._cache.clear()
@@ -81,7 +81,7 @@
Modifies *data* in place.
- .. version-changed:: 10.5
+ .. versionchanged:: 10.5
Modify *data* for formatversion 1 compatibility and easier
to use lists.
@@ -333,7 +333,7 @@
def is_cached(self, key: str) -> bool:
"""Return whether the value is cached.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
"""
try:
self._get_cached(key)
@@ -349,7 +349,7 @@
like `key in container`.Only string keys are valid. Non-string
keys always return False.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
Previous implementation only checked for cached keys.
:param key: The key to check for presence. Should be a string.
diff --git a/pywikibot/site/_tokenwallet.py b/pywikibot/site/_tokenwallet.py
index 8e93b5d..d2410da 100644
--- a/pywikibot/site/_tokenwallet.py
+++ b/pywikibot/site/_tokenwallet.py
@@ -34,7 +34,7 @@
def __getitem__(self, key: str) -> str:
"""Get token value for the given key.
- .. version-changed:: 11.0
+ .. versionchanged:: 11.0
Support of legacy API tokens was dropped.
"""
if self.site.user() is None and key != 'login':
@@ -77,7 +77,7 @@
>>> repr(site.tokens)
"TokenWallet(pywikibot.Site('wikipedia:test'))"
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Provide a string which looks like a valid Python expression.
"""
user = f', user={self._currentuser!r}' if self._currentuser else ''
@@ -87,7 +87,7 @@
def clear(self) -> None:
"""Clear the self._tokens cache. Tokens are reloaded when needed.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
self._tokens.clear()
@@ -111,7 +111,7 @@
r._params['token'] = r.site.tokens.update_tokens(r._params['token'])
- .. version-added:: 8.0
+ .. versionadded:: 8.0
:param tokens: A list of token types that need to be updated.
:return: A list of updated tokens corresponding to the given
diff --git a/pywikibot/site/_upload.py b/pywikibot/site/_upload.py
index 3d4c44b..9ce19a1 100644
--- a/pywikibot/site/_upload.py
+++ b/pywikibot/site/_upload.py
@@ -23,7 +23,7 @@
"""Uploader class to upload a file to the wiki.
- .. version-added:: 7.1
+ .. versionadded:: 7.1
:param site: The current site to work on
:param filepage: a FilePage object from which the wiki-name of the
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index 0ccd9c3..97f59d3 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -275,11 +275,11 @@
def check_response(response) -> None:
"""Raise ClientError or ServerError depending on http status.
- .. version-added:: 3.0
- .. version-changed:: 7.0
+ .. versionadded:: 3.0
+ .. versionchanged:: 7.0
Raise a generic :class:`exceptions.ServerError` if http status
code is not IANA-registered but unofficial code
- .. version-changed:: 8.1
+ .. versionchanged:: 8.1
Raise a :class:`exceptions.ClientError` if status code is 4XX
"""
for status_code, err_class, err_type in [
diff --git a/pywikibot/specialbots/_upload.py b/pywikibot/specialbots/_upload.py
index d65602c..d25a859 100644
--- a/pywikibot/specialbots/_upload.py
+++ b/pywikibot/specialbots/_upload.py
@@ -48,7 +48,7 @@
bot.post_processor = summarize
bot.run()
- .. version-added:: 9.1
+ .. versionadded:: 9.1
"""
def __init__(self, url: list[str] | str, *,
@@ -68,9 +68,9 @@
**kwargs) -> None:
"""Initializer.
- .. version-changed:: 6.2
+ .. versionchanged:: 6.2
asynchronous upload is used if *asynchronous* parameter is set
- .. version-changed:: 6.4
+ .. versionchanged:: 6.4
*force_if_shared* parameter was added
:param url: path to url or local file, or list of urls or paths
@@ -239,7 +239,7 @@
def process_filename(self, file_url: str) -> str | None:
"""Return base filename portion of *file_url*.
- .. version-changed:: 10.2
+ .. versionchanged:: 10.2
no longer shows the description if UploadRobot's parameter
*verify_description* is set to False.
@@ -394,7 +394,7 @@
If the upload fails, ask the user whether to try again or not.
If the user chooses not to retry, return None.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
If 'copyuploadbaddomain' API error occurred in first step,
download the file and upload it afterwards
@@ -473,7 +473,7 @@
def run(self) -> None:
"""Run bot.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
count uploads.
"""
if self.skip_run():
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 1915019..e9267ee 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -117,7 +117,7 @@
languages, and that it returns an unchanged string if an
unsupported language is given.
- .. version-changed:: 7.5
+ .. versionchanged:: 7.5
always return a string even `phrase` is an int.
:param phrase: The phrase to convert to localized numerical
@@ -136,8 +136,8 @@
langs: Sequence[str] | str | None = None) -> str:
"""Change non-ascii digits to ascii digits.
- .. version-added:: 7.0
- .. version-changed:: 10.3
+ .. versionadded:: 7.0
+ .. versionchanged:: 10.3
this function was renamed from to_latin_digits.
:param phrase: The phrase to convert to ascii numerical.
@@ -161,8 +161,8 @@
def case_escape(case: str, string: str, *, underscore: bool = False) -> str:
"""Return an escaped regex pattern which depends on 'first-letter' case.
- .. version-added:: 7.0
- .. version-changed:: 8.4
+ .. versionadded:: 7.0
+ .. versionchanged:: 8.4
Added the optional *underscore* parameter.
:param case: if `case` is 'first-letter', the regex contains an
@@ -225,7 +225,7 @@
def ignore_case(string: str) -> str:
"""Return a case-insensitive pattern for the string.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`_ignore_case` becomes a public method
"""
return ''.join(
@@ -313,7 +313,7 @@
) -> list[re.Pattern[str]]:
"""Fetch compiled regexes.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
``_get_regexes`` becomes a public function.
*keys* may be a single string; *site* is optional.
@@ -509,7 +509,7 @@
* includeonly tags
* source and syntaxhighlight tags
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
the order of removals will correspond to the tags argument
if provided as an ordered collection (list, tuple)
@@ -563,7 +563,7 @@
.. caution:: Tag names must be given in lowercase.
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
The *removetags* parameter was added. Refactored to use
:class:`GetDataHTML` and its ``__call__`` method. tag attributes
will be kept.
@@ -637,10 +637,10 @@
.. caution:: Tag names must be given in lowercase.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
No longer a context manager
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
Public class now. Added support for removals of tag contents.
.. seealso::
@@ -708,7 +708,7 @@
listed in *removetags* begin a skip block, and their content
will be excluded from the output.
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
Keep tag attributes.
:param tag: The tag name (e.g., "div", "script") converted to
@@ -819,7 +819,7 @@
function which returns a Link instance and copies the value which should
remaining.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
`site` parameter is mandatory
:param text: the text in which to replace links
@@ -1043,7 +1043,7 @@
def add_text(text: str, add: str, *, site=None) -> str:
"""Add text to a page content above categories and interwiki.
- .. version-added:: 6.4
+ .. versionadded:: 6.4
:param text: The page content to add text to.
:param add: Text to add.
@@ -1091,7 +1091,7 @@
"""A namedtuple as part of :class:`Content` describing a page section.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
``_Section`` becomes a public class.
"""
@@ -1102,7 +1102,7 @@
def level(self) -> int:
"""Return the section level.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
"""
m = HEAD_PATTERN.match(self.title)
return len(m[1])
@@ -1111,7 +1111,7 @@
def heading(self) -> str:
"""Return the section title without equal signs.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
"""
level = self.level
return self.title[level:-level].strip()
@@ -1124,7 +1124,7 @@
Introduced for handling lists of sections with custom lookup by
:attr:`Section.heading` and :attr:`level<Section.level>`.
- .. version-added:: 10.4
+ .. versionadded:: 10.4
"""
def __contains__(self, value: object) -> bool:
@@ -1216,7 +1216,7 @@
"""A namedtuple as result of :func:`extract_sections` holding page content.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
``_Content`` becomes a public class.
"""
@@ -1230,7 +1230,7 @@
The first main title is anything enclosed within triple quotes.
- .. version-added:: 8.2
+ .. versionadded:: 8.2
"""
m = TITLE_PATTERN.search(self.header)
return m[1].strip() if m else ''
@@ -1331,11 +1331,11 @@
.. note:: sections and text from templates are not extracted but
embedded as plain text.
- .. version-added:: 3.0
- .. version-changed:: 8.2
+ .. versionadded:: 3.0
+ .. versionchanged:: 8.2
The :class:`Content` and :class:`Section` class have additional
properties.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
Added custom ``index()``, ``count()`` and ``in`` operator support
for :attr:`Content.sections`.
@@ -1512,7 +1512,7 @@
template_subpage: bool = False) -> str:
"""Replace inter-language links in the text with a new set of links.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*addOnly* was renamed to *add_only*.
:param oldtext: The text that needs to be modified.
@@ -1843,7 +1843,7 @@
add_only: bool = False) -> str:
"""Replace all existing category links with new category links.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*addOnly* was renamed to *add_only*.
:param oldtext: The text that needs to be replaced.
@@ -2046,7 +2046,7 @@
:param strip: If enabled, strip arguments and values of templates.
:return: list of template name and params
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
*wikitextparser* package is supported; either *wikitextparser* or
*mwparserfromhell* is strictly recommended.
"""
@@ -2195,7 +2195,7 @@
Attribute order is important to avoid mismatch when searching.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
time: re.Pattern[str]
@@ -2209,7 +2209,7 @@
"""Find timestamp in page and return it as pywikibot.Timestamp object.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
*group* attribute is a set instead of a list.
*patterns* is a :class:`TimeStripperPatterns` namedtuple instead
of a list.
@@ -2348,7 +2348,7 @@
All the following items must be matched, otherwise None is
returned: -. year, month, hour, time, day, minute, tzinfo
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
HTML parts are removed from line
:return: A timestamp found on the given line
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index d58a5cf..0fe30ad 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -102,7 +102,7 @@
def next_multiplicity(self) -> float:
"""Factor to scale delay time based on upcoming request size.
- .. version-deprecated:: 10.3.0
+ .. deprecated:: 10.3.0
"""
return 1.0
@@ -111,7 +111,7 @@
def next_multiplicity(self, value: float) -> None:
"""Setter for delay scaling factor for the next request.
- .. version-deprecated:: 10.3.0
+ .. deprecated:: 10.3.0
This property has no effect and is retained for backward
compatibility.
"""
@@ -120,7 +120,7 @@
def _module_hash(module: str | None = None) -> str:
"""Convert called module name to a hash.
- .. version-changed:: 11.0
+ .. versionchanged:: 11.0
Set hashlib constructor *usedforsecurity* argument to ``False``
because the hash is not used in a security context. Use ``md5``
hash algorithm for GraalPy implementation instead of
@@ -175,7 +175,7 @@
def checkMultiplicity(self) -> None:
"""Count running processes for site and set process_multiplicity.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
process is not written to throttle.ctrl file if site is empty.
"""
global pid
@@ -227,7 +227,7 @@
) -> None:
"""Set the nominal delays in seconds.
- .. version-deprecated:: 10.3.0
+ .. deprecated:: 10.3.0
Use :meth:`set_delays` instead.
"""
self.set_delays(delay=delay, writedelay=writedelay, absolute=absolute)
@@ -242,7 +242,7 @@
Defaults to config values.
- .. version-added:: 10.3.0
+ .. versionadded:: 10.3.0
Renamed from :meth:`setDelays`.
"""
with self.lock:
@@ -261,7 +261,7 @@
def getDelay(self, write: bool = False) -> float:
"""Return the current delay, adjusted for active processes.
- .. version-deprecated:: 10.3.0
+ .. deprecated:: 10.3.0
Use :meth:`get_delay` instead.
"""
return self.get_delay(write=write)
@@ -274,7 +274,7 @@
time has already passed since the last access — use
:meth:`waittime` for that.
- .. version-added:: 10.3.0
+ .. versionadded:: 10.3.0
Renamed from :meth:`getDelay`.
:param write: Whether the operation is a write (uses writedelay).
@@ -342,10 +342,10 @@
This method blocks the calling thread if the minimum delay has
not yet elapsed since the last read or write operation.
- .. version-changed:: 10.3.0
+ .. versionchanged:: 10.3.0
The *write* parameter is now keyword-only.
- .. version-deprecated:: 10.3.0
+ .. deprecated:: 10.3.0
The *requestsize* parameter has no effect and will be removed
in a future release.
diff --git a/pywikibot/time.py b/pywikibot/time.py
index 42706d8..1e980b2 100644
--- a/pywikibot/time.py
+++ b/pywikibot/time.py
@@ -1,6 +1,6 @@
"""Time handling module.
-.. version-added:: 7.5
+.. versionadded:: 7.5
"""
#
# (C) Pywikibot team, 2007-2025
@@ -28,7 +28,7 @@
'TZoneFixedOffset'
)
-#: .. version-added:: 7.5
+#: .. versionadded:: 7.5
MW_KEYS = types.MappingProxyType({
's': 'seconds',
'h': 'hours',
@@ -67,7 +67,7 @@
this is more reliable than using :meth:`Timestamp.utcnow` or
:meth:`Timestamp.nowutc`.
- .. version-changed:: 7.5
+ .. versionchanged:: 7.5
moved to :mod:`time` module
"""
@@ -88,8 +88,8 @@
- ISO8601 format: ``YYYY-MM-DD[T ]HH:MM:SS[Z|±HH[MM[SS[.ffffff]]]]``
- POSIX format: seconds from Unix epoch ``S{1,13}[.ffffff]]``
- .. version-added:: 7.5
- .. version-changed:: 8.0
+ .. versionadded:: 7.5
+ .. versionchanged:: 8.0
raises *TypeError* instead of *ValueError*.
:param ts: Timestamp, datetime.datetime or str
@@ -109,7 +109,7 @@
def _from_datetime(dt: datetime.datetime) -> Timestamp:
"""Convert a datetime.datetime timestamp to a Timestamp object.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
return Timestamp(dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second, dt.microsecond,
@@ -121,7 +121,7 @@
Mediwiki timestamp format: YYYYMMDDHHMMSS
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
RE_MW = r'\d{14}' # noqa: N806
m = re.fullmatch(RE_MW, timestr)
@@ -139,7 +139,7 @@
ISO8601 format:
``YYYY-MM-DD[T ]HH:MM:SS[[.,]ffffff][Z|±HH[MM[SS[.ffffff]]]]``
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
RE_ISO8601 = (r'(?:\d{4}-\d{2}-\d{2})(?P<sep>[T ])' # noqa: N806
r'(?:\d{2}:\d{2}:\d{2})(?P<u>[.,]\d{1,6})?'
@@ -179,7 +179,7 @@
POSIX format: ``SECONDS[.ffffff]]``
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
RE_POSIX = r'(?P<S>-?\d{1,13})(?:\.(?P<u>\d{1,6}))?' # noqa: N806
m = re.fullmatch(RE_POSIX, timestr)
@@ -202,7 +202,7 @@
def _from_string(cls, timestr: str) -> Timestamp:
"""Convert a string to a Timestamp object.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
handlers = [
cls._from_mw,
@@ -261,9 +261,9 @@
strict: bool = False) -> Timestamp:
"""Convert a MediaWiki internal timestamp to a Timestamp object.
- .. version-changed:: 3.0
+ .. versionchanged:: 3.0
create a Timestamp if only year, month and day are given.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
the *strict* parameter was added which discards missing
element tolerance.
@@ -319,21 +319,21 @@
See Note in datetime.timestamp().
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
return self.replace(tzinfo=datetime.timezone.utc).timestamp()
def posix_timestamp_format(self) -> str:
"""Convert object to a POSIX timestamp format.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
return f'{self.posix_timestamp():.6f}'
def __repr__(self) -> str:
"""Unify repr string between CPython and Pypy (T325905).
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
s = super().__repr__()
return f'{type(self).__name__}{s[s.find("("):]}'
@@ -365,7 +365,7 @@
aware Timestamps/datetimes (i.e. missing or having timezone).
A TypeError will be raised in such cases.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
.. seealso::
- :python:`datetime.now()
<library/datetime.html#datetime.datetime.now>`
@@ -411,7 +411,7 @@
.. hint::
This method might be deprecated later.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
.. seealso::
:python:`datetime.utcnow()
<library/datetime.html#datetime.datetime.utcnow>`
diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index 58743b7..1d381be 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -23,7 +23,7 @@
entries such as "all:" or "xyz:" or "20:" are first built from the
page title of 'page' and then listed.
- .. version-changed:: 9.6
+ .. versionchanged:: 9.6
Raise ``RuntimeError`` instead of ``AssertionError`` if neither
*page* nor *site* parameter is given.
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 5fbf0d8..9ad6b55 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -100,7 +100,7 @@
def is_ip_address(value: str) -> bool:
"""Check if a value is a valid IPv4 or IPv6 address.
- .. version-added:: 6.1
+ .. versionadded:: 6.1
Was renamed from ``is_IP()``.
.. seealso:: :func:`is_ip_network`
@@ -116,7 +116,7 @@
def is_ip_network(value: str) -> bool:
"""Check if a value is a valid range of IPv4 or IPv6 addresses.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
.. seealso:: :func:`is_ip_address`
:param value: value to check
@@ -131,9 +131,9 @@
def has_module(module: str, version: str | None = None) -> bool:
"""Check if a module can be imported.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
Dependency of distutils was dropped because the package will be
removed with Python 3.12.
"""
@@ -170,7 +170,7 @@
Foo.bar gives 'baz'.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def __init__(self, cls_method) -> None:
@@ -206,7 +206,7 @@
Those suppressed warnings that do not match the parameters will be
raised shown upon exit.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def __init__(
@@ -271,7 +271,7 @@
"""Mixin class to allow comparing to other objects which are comparable.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
@abc.abstractmethod
@@ -280,7 +280,7 @@
This ensures that ``_cmpkey`` method is defined in subclass.
- .. version-added:: 8.1.2
+ .. versionadded:: 8.1.2
"""
def __lt__(self, other):
@@ -318,7 +318,7 @@
>>> first_lower('Hello World')
'hello World'
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
return string[:1].lower() + string[1:]
@@ -333,7 +333,7 @@
>>> first_upper('hello World')
'Hello World'
- .. version-added:: 3.0
+ .. versionadded:: 3.0
.. note:: MediaWiki doesn't capitalize some characters the same way
as Python. This function tries to be close to MediaWiki's
capitalize function in title.php. See :phab:`T179115` and
@@ -372,7 +372,7 @@
...
ValueError: Invalid repl parameter '?'
- .. version-added:: 8.0
+ .. versionadded:: 8.0
:param string: the string to be modified
:param repl: the replacement character
@@ -401,7 +401,7 @@
...
ValueError: invalid truth value 'aye'
- .. version-added:: 7.1
+ .. versionadded:: 7.1
:param val: True values are 'y', 'yes', 't', 'true', 'on', and '1';
false values are 'n', 'no', 'f', 'false', 'off', and '0'.
@@ -418,7 +418,7 @@
def normalize_username(username) -> str | None:
"""Normalize the username.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
if not username:
return None
@@ -447,9 +447,9 @@
Any other suffixes are considered invalid.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
- .. version-changed:: 6.1
+ .. versionchanged:: 6.1
Dependency of distutils was dropped because the package will be
removed with Python 3.12.
"""
@@ -516,7 +516,7 @@
def __repr__(self) -> str:
"""Return version number representation, mainly used by tests.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
"""
return f"'{self}'"
@@ -553,7 +553,7 @@
The compression is either selected via the magic number or file
ending.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
:param filename: The filename.
:param use_extension: Use the file extension instead of the magic
@@ -652,7 +652,7 @@
also possible to define an additional dict using the keyword
arguments.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
args = [*list(args), dict(kwargs)]
conflicts = set()
@@ -675,7 +675,7 @@
) -> None:
"""Check file mode and update it, if needed.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
:param filename: filename path
:param mode: requested file mode
@@ -707,8 +707,8 @@
Result is expressed as hexdigest().
- .. version-added:: 3.0
- .. version-changed:: 8.2
+ .. versionadded:: 3.0
+ .. versionchanged:: 8.2
*sha* may be also a hash constructor, or a callable that returns
a hash object.
@@ -766,7 +766,7 @@
.. note:: A property must be decorated on top of the property method
below other decorators. This decorator must not be used with
functions.
- .. version-added:: 7.3
+ .. versionadded:: 7.3
:raises TypeError: decorator must be used without arguments
"""
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index 50e7d0c..f67f91d 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -15,7 +15,7 @@
only one arg, and that arg be a callable, as it will be detected as
a deprecator without any arguments.
-.. version-changed:: 6.4
+.. versionchanged:: 6.4
deprecation decorators moved to _deprecate submodule
"""
#
@@ -53,7 +53,7 @@
"""Feature that is no longer implemented.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
@@ -83,7 +83,7 @@
def manage_wrapping(wrapper, obj) -> None:
"""Add attributes to wrapper and wrapped functions.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
wrapper.__doc__ = obj.__doc__
wrapper.__name__ = obj.__name__
@@ -111,7 +111,7 @@
def get_wrapper_depth(wrapper):
"""Return depth of wrapper function.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
return wrapper.__wrapped__.__wrappers__ + (1 - wrapper.__depth__)
@@ -178,9 +178,9 @@
def _build_msg_string(instead: str | None, since: str | None) -> str:
"""Build a deprecation warning message format string.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
`since`parameter must be a release number, not a timestamp.
:param instead: suggested replacement for the deprecated object
@@ -203,10 +203,10 @@
since: str | None = None) -> None:
"""Issue a deprecation warning.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
*since* parameter must be a release number, not a timestamp.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*warning_class* and *since* are keyword-only parameters.
:param name: the name of the deprecated object
@@ -226,7 +226,7 @@
def deprecated(*args, **kwargs):
"""Decorator to output a deprecation warning.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
`since` keyword must be a release number, not a timestamp.
:keyword str instead: if provided, will be used to specify the
@@ -339,7 +339,7 @@
reserved words even for future Python releases and to prevent syntax
errors.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
bool type of *new_arg* is no longer supported.
:param old_arg: old keyword
@@ -359,12 +359,12 @@
def my_function(bar='baz'): pass
# replaces 'foo' keyword by 'bar' and ignores 'baz' keyword
- .. version-changed:: 3.0.20200703
+ .. versionchanged:: 3.0.20200703
show a FutureWarning if the *arg_pairs* value is True; don't show
a warning if the value is an empty string.
- .. version-changed:: 6.4
+ .. versionchanged:: 6.4
show a FutureWarning for renamed arguments
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
bool type argument is no longer supported.
:param arg_pairs: Each entry points to the new argument name. If an
@@ -497,10 +497,10 @@
keyword-only arguments must match the order of the old positional
parameters; otherwise, argument assignment may fail.
- .. version-added:: 9.2
- .. version-changed:: 10.4
+ .. versionadded:: 9.2
+ .. versionchanged:: 10.4
Raises ``ValueError`` if method has a ``*args`` parameter.
- .. version-changed:: 10.6
+ .. versionchanged:: 10.6
Renamed from ``deprecate_positionals``. Adds handling of
positional-only parameters and emits warnings if they are passed
as keyword arguments.
@@ -697,10 +697,10 @@
It also acts like marking that function deprecated and copies all
parameters.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
*since* parameter must be a release number, not a timestamp.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
All parameters except *target* are keyword-only parameters.
:param target: The targeted function which is to be executed.
@@ -777,7 +777,7 @@
future_warning: bool = True) -> None:
"""Add the name to the local deprecated names dict.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
``since`` parameter must be a release number, not a timestamp.
:param name: The name of the deprecated class or variable. It may not
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index ce1551b..c4a9d87 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -98,7 +98,7 @@
For a single *encodings* string this function is equivalent to
:samp:`urllib.parse.unquote(title, encodings, errors='strict')`
- .. version-changed:: 8.4
+ .. versionchanged:: 8.4
Ignore *LookupError* and try other encodings.
.. seealso:: :python:`urllib.parse.unquote
diff --git a/pywikibot/tools/collections.py b/pywikibot/tools/collections.py
index 3b14ca2..4ea3d87 100644
--- a/pywikibot/tools/collections.py
+++ b/pywikibot/tools/collections.py
@@ -63,7 +63,7 @@
>>> list(data)
[]
- .. version-added:: 6.1
+ .. versionadded:: 6.1
"""
def __init__(self, keyattr: str) -> None:
@@ -144,7 +144,7 @@
"""An error that gets caught by both KeyError and IndexError.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
@@ -159,8 +159,8 @@
Accessing a value via __getitem__ will result in a combined KeyError and
IndexError.
- .. version-added:: 3.0
- .. version-changed:: 6.2
+ .. versionadded:: 3.0
+ .. versionchanged:: 6.2
``empty_iterator()`` was removed in favour of ``iter()``.
"""
@@ -185,8 +185,8 @@
"""A generator that allows items to be added during generating.
- .. version-added:: 3.0
- .. version-changed:: 6.1
+ .. versionadded:: 3.0
+ .. versionchanged:: 6.1
Provide a representation string.
"""
@@ -212,7 +212,7 @@
<reference/expressions.html#generator.close>` mixin method and it can
be used as Iterable and Iterator as well.
- .. version-added:: 7.6
+ .. versionadded:: 7.6
Example:
@@ -290,10 +290,10 @@
<reference/expressions.html#generator.throw>` for various
parameter usage.
- .. version-changed:: 10.7
+ .. versionchanged:: 10.7
The *val* and *tb* parameters were renamed to *value* and
*traceback*.
- .. version-deprecated:: 10.7
+ .. deprecated:: 10.7
The ``(type, value, traceback)`` signature is deprecated; use
single-arg signature ``throw(value)`` instead.
@@ -364,7 +364,7 @@
>>> newlimit.ratio
inf
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
group: str = 'unknown'
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index ab7cbe7..d2e8fdc 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -1,6 +1,6 @@
"""Module containing various formatting related utilities."""
#
-# (C) Pywikibot team, 2015-2025
+# (C) Pywikibot team, 2015-2024
#
# Distributed under the terms of the MIT license.
#
@@ -57,7 +57,7 @@
def output(self) -> None:
"""Output the text of the current sequence.
- .. version-deprecated:: 9.0
+ .. deprecated:: 9.0
Use :func:`pywikibot.info()<pywikibot.logging.info>` with
:attr:`out` property.
"""
diff --git a/pywikibot/tools/itertools.py b/pywikibot/tools/itertools.py
index 867a98b..7937989 100644
--- a/pywikibot/tools/itertools.py
+++ b/pywikibot/tools/itertools.py
@@ -77,7 +77,7 @@
>>> list(union_generators([4, 3, 2, 1], [5, 4, 3], [6, 2], reverse=True))
[6, 5, 4, 3, 2, 1]
- .. version-added:: 10.6
+ .. versionadded:: 10.6
.. note::
All input iterables must be sorted consistently. *reverse* must
@@ -116,19 +116,19 @@
['m', 'i', 's', 's', 'i']
- .. version-added:: 3.0
+ .. versionadded:: 3.0
- .. version-changed:: 5.0
+ .. versionchanged:: 5.0
Avoid duplicates (:phab:`T263947`).
- .. version-changed:: 6.4
+ .. versionchanged:: 6.4
``genlist`` was renamed to ``iterables``; consecutive iterables
are to be used as iterables parameters or '*' to unpack a list
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
Reimplemented without threads which is up to 10'000 times faster
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Iterable elements may consist of lists or tuples
``allow_duplicates`` is a keyword-only argument
@@ -205,8 +205,8 @@
>>> tuple(roundrobin_generators('ABC', range(5)))
('A', 0, 'B', 1, 'C', 2, 3, 4)
- .. version-added:: 3.0
- .. version-changed:: 6.4
+ .. versionadded:: 3.0
+ .. versionchanged:: 6.4
A sentinel variable is used to determine the end of an iterable
instead of None.
@@ -248,7 +248,7 @@
.. warning:: This is not thread safe.
- .. version-added:: 3.0
+ .. versionadded:: 3.0
:param iterable: the source iterable
:type iterable: collections.abc.Iterable
diff --git a/pywikibot/tools/threading.py b/pywikibot/tools/threading.py
index 8c94f6e..83c40de 100644
--- a/pywikibot/tools/threading.py
+++ b/pywikibot/tools/threading.py
@@ -47,7 +47,7 @@
>>> data
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
- .. version-added:: 3.0
+ .. versionadded:: 3.0
"""
def __init__(self, group=None, target=None, name: str = 'GeneratorThread',
@@ -135,7 +135,7 @@
for x in range(20):
pool.append(threading.Thread(target=work))
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
the unintentional and undocumented *args* parameter was removed.
.. seealso:: :class:`BoundedPoolExecutor`
@@ -183,7 +183,7 @@
block further items on :meth:`submit` calls to be added to workers
queue if the *max_bound* limit is reached.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
.. seealso::
- :pylib:`concurrent.futures.html#executor-objects`
diff --git a/pywikibot/userinterfaces/_interface_base.py b/pywikibot/userinterfaces/_interface_base.py
index 1e2b776..d754eeb 100644
--- a/pywikibot/userinterfaces/_interface_base.py
+++ b/pywikibot/userinterfaces/_interface_base.py
@@ -1,9 +1,9 @@
"""Abstract base user interface module.
-.. version-added:: 6.2
+.. versionadded:: 6.2
"""
#
-# (C) Pywikibot team, 2021-2025
+# (C) Pywikibot team, 2021
#
# Distributed under the terms of the MIT license.
#
@@ -21,7 +21,7 @@
Every user interface should derive from it to ensure that all
required methods are implemented.
- .. version-added:: 6.2
+ .. versionadded:: 6.2
"""
def argvu(self) -> list[str]:
diff --git a/pywikibot/userinterfaces/buffer_interface.py b/pywikibot/userinterfaces/buffer_interface.py
index 864f4ff..3fba15c 100644
--- a/pywikibot/userinterfaces/buffer_interface.py
+++ b/pywikibot/userinterfaces/buffer_interface.py
@@ -1,6 +1,6 @@
"""Non-interactive interface that stores output.
-.. version-added:: 6.4
+.. versionadded:: 6.4
"""
#
# (C) Pywikibot team, 2021-2025
@@ -23,7 +23,7 @@
"""Collects output into an unseen buffer.
- .. version-added:: 6.4
+ .. versionadded:: 6.4
"""
def __init__(self) -> None:
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index ce3e8b9..00509da 100644
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -60,7 +60,7 @@
"""Base for terminal user interfaces.
- .. version-changed:: 6.2:
+ .. versionchanged:: 6.2:
subclassed from
:py:obj:`userinterfaces._interface_base.ABUIC`
"""
@@ -73,7 +73,7 @@
This caches the std-streams locally so any attempts to
monkey-patch the streams later will not work.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
memorize original streams
"""
# for Windows GUI they can be None under some conditions
@@ -164,7 +164,7 @@
against the frozen streams, and then write to the (potentially
redirected) `sys.stderr` or `sys.stdout` stream.
- .. version-changed:: 7.1
+ .. versionchanged:: 7.1
instead of writing to `target_stream`, dispatch to
`sys.stderr` or `sys.stdout`.
"""
@@ -242,7 +242,7 @@
in cache. They will be printed with next unlocked output call or
at termination time.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
Forward text to cache and flush if output is not locked.
"""
self.cache_output(text, targetStream=targetStream)
@@ -252,7 +252,7 @@
def flush(self) -> None:
"""Output cached text.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
with self.lock:
for args, kwargs in self.cache:
@@ -262,7 +262,7 @@
def cache_output(self, *args, **kwargs) -> None:
"""Put text to cache.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
with self.lock:
self.cache.append((args, kwargs))
@@ -274,7 +274,7 @@
terminal, it will be replaced with a question mark or by a
transliteration.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
``UI.output()`` was renamed to ``UI.stream_output()``
"""
if config.transliterate:
@@ -418,7 +418,7 @@
not be sensible when the option supports multiple values as
it'll return an ambiguous index.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
Raise ValueError if no *default* value is given with *force*;
raise ValueError if *force* is True and *default* value is
invalid; raise TypeError if *default* value is neither str
diff --git a/pywikibot/userinterfaces/transliteration.py b/pywikibot/userinterfaces/transliteration.py
index 869c279..94179b4 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -1132,9 +1132,9 @@
prev: str = '-', succ: str = '-') -> str:
"""Transliterate the character.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
*next* parameter was renamed to *succ*.
- .. version-changed:: 10.6
+ .. versionchanged:: 10.6
*char* argument is positional only; *prev* and *succ*
arguments are keyword only.
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 6dab2cf..bc93788 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -36,8 +36,8 @@
def get_toolforge_hostname() -> str | None:
"""Get hostname of the current Toolforge host.
- .. version-added:: 3.0
- .. version-deprecated:: 9.0
+ .. versionadded:: 3.0
+ .. deprecated:: 9.0
:return: The hostname of the currently running host,
if it is in Wikimedia Toolforge; otherwise return None.
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py
index bb37ccf..e201b72 100644
--- a/pywikibot/xmlreader.py
+++ b/pywikibot/xmlreader.py
@@ -6,7 +6,7 @@
https://dumps.wikimedia.org/backup-index.html) and offers a generator over
XmlEntry objects which can be used by other bots.
-.. version-changed:: 7.7
+.. versionchanged:: 7.7
*defusedxml* is used in favour of *xml.etree* if present to prevent
vulnerable XML attacks. *defusedxml* 0.7.1 or higher is recommended.
"""
@@ -61,7 +61,7 @@
"""Represent the common info of a page.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
title: str
@@ -76,7 +76,7 @@
"""Represent a raw revision.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
headers: Headers
@@ -91,11 +91,11 @@
Reads the local file at initialization,
parses it, and offers access to the resulting XmlEntries via a generator.
- .. version-added:: 7.2
+ .. versionadded:: 7.2
the `on_error` parameter
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`allrevisions` parameter must be given as keyword parameter
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
`allrevisions` parameter is deprecated due to :phab:`T340804`,
`revisions` parameter was introduced as replacement.
`root` attribute was removed.
@@ -173,7 +173,7 @@
def parse(self) -> Iterator[XmlEntry]:
"""Generator using ElementTree iterparse function.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
if a ParseError occurs it can be handled by the callable
given with `on_error` parameter of this instance.
"""
@@ -212,7 +212,7 @@
def _parse_only_first_found(self, elem: Element) -> Iterator[XmlEntry]:
"""Parser that yields the first revision found.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
raw_revs = self._fetch_revs(elem)
try:
@@ -231,7 +231,7 @@
def _parse_only_earliest(self, elem: Element) -> Iterator[XmlEntry]:
"""Parser that yields only the earliest revision.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
raw_revs = self._fetch_revs(elem, with_id=True)
raw_rev = min(raw_revs, default=None, key=lambda rev: rev.revid)
@@ -247,7 +247,7 @@
def _fetch_revs(self, elem: Element, with_id=False) -> Iterator[RawRev]:
"""Yield all revisions in a page.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
uri = self.uri
headers = self._headers(elem)
@@ -262,7 +262,7 @@
Returns strings representing user groups allowed to edit and
to move a page, where None means there are no restrictions.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
replaces deprecated ``parseRestrictions`` function.
"""
if not restrictions:
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index c0a2f7a..369d5cc 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -168,23 +168,23 @@
Version historty:
-.. version-changed:: 7.6
+.. versionchanged:: 7.6
Localized variables for the ``archive`` parameter are supported.
``User:MiszaBot/config`` is the default template. The ``-keep`` option
was added.
-.. version-changed:: 7.7
+.. versionchanged:: 7.7
``-sort`` and ``-async`` options were added.
-.. version-changed:: 8.2
+.. versionchanged:: 8.2
KeyboardInterrupt support added when using the ``-async`` option.
-.. version-changed:: 10.3
+.. versionchanged:: 10.3
If ``archiveheader`` is not set, the bot now attempts to retrieve a
localized template from Wikidata (based on known item IDs). If none is
found, ``{{talkarchive}}`` is used as fallback.
-.. version-changed:: 11.0
+.. versionchanged:: 11.0
The ``-namespace`` option is now respected by ``-page`` option.
"""
#
@@ -410,7 +410,7 @@
def __getattr__(self, name):
"""Lazy load page if archives, header or threads attribute is missing.
- .. version-added:: 8.1
+ .. versionadded:: 8.1
"""
if name in ('archives', 'header', 'threads'):
self.load_page()
@@ -423,7 +423,7 @@
) -> pywikibot.Timestamp | None:
"""Calculate the maximum of two timestamps but allow None as value.
- .. version-added:: 7.6
+ .. versionadded:: 7.6
"""
if ts1 is None:
return ts2
@@ -443,9 +443,9 @@
If no such localized template is found, it falls back to the
default ``{{talkarchive}}`` template.
- .. version-added:: 10.2
+ .. versionadded:: 10.2
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
Returns ``{{talkarchive}}`` by default if no localized
template is found.
@@ -464,10 +464,10 @@
def load_page(self) -> None:
"""Load the page to be archived and break it up into threads.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
If `-keep` option is given run through all threads and set
the current timestamp to the previous if the current is lower.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
Load unsigned threads using timestamp of the next thread.
"""
self.header = ''
@@ -547,7 +547,7 @@
(characters). This corresponds to MediaWiki's definition
of page size.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
return 0 if archive page neither exists nor has threads
(:phab:`T313886`).
"""
@@ -563,7 +563,7 @@
asynchronous: bool = False) -> None:
"""Recombine threads and save page.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
the *asynchronous* parameter was added.
"""
if sort_threads:
@@ -590,7 +590,7 @@
asynchronous: bool = False) -> None:
"""Initializer.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
The *asynchronous* parameter was added.
:param page: a page object to be archived
@@ -635,7 +635,7 @@
def info(self, msg: str = '') -> None:
"""Forward text to cache if asynchronous is activated.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
"""
if self.asynchronous:
self.output.append(msg)
@@ -645,7 +645,7 @@
def flush(self) -> None:
"""Flush the cache.
- .. version-added:: 10.0
+ .. versionadded:: 10.0
"""
pywikibot.info('\n'.join(self.output))
self.output.clear()
@@ -892,7 +892,7 @@
def run(self) -> None:
"""Process a single DiscussionPage object.
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
save the talk page in asynchronous mode if ``-async`` option
was given but archive pages are saved in synchronous mode.
"""
@@ -966,10 +966,10 @@
:return: Return True to continue with the next page, False to break
the loop.
- .. version-added:: 7.6
- .. version-changed:: 7.7
+ .. versionadded:: 7.6
+ .. versionchanged:: 7.7
pass an unspecified number of arguments to the bot using ``*args``
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
*asynchronous* parameter was added.
"""
global outlock
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index c8581a6..2348e46 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -185,7 +185,7 @@
"""Bot to remove stale protection templates from unprotected pages.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/category.py b/scripts/category.py
index 230e20c..86be2c8 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -149,7 +149,7 @@
The sample above would remove 'Hydraulics' category from all pages which
are also in 'Pneumatics' category.
-.. version-changed:: 8.0
+.. versionchanged:: 8.0
:mod:`pagegenerators` are supported with "move" and "remove" action.
"""
#
@@ -583,7 +583,7 @@
Per default the operation applies to pages and subcategories.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
The ``generator`` parameter.
"""
@@ -730,7 +730,7 @@
- _change()
- _delete()
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
if a page generator is given to the bot, the intersection
with :func:`pagegenerators.CategorizedPageGenerator` or
:func:`pagegenerators.SubCategoriesPageGenerator` is used.
@@ -1345,7 +1345,7 @@
robot = CategoryTreeRobot(
'Physics', db, 'physics_tree.txt', max_depth=5)
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
*max_depth* is keyword only.
:param cat_title: The category that serves as the root of the
@@ -1397,7 +1397,7 @@
given category *cat*, up to the depth specified by
``self.max_depth``. This method is recursive.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
*parent* is keyword only.
Example:
@@ -1482,7 +1482,7 @@
- :wiki:`WP:SUBCAT`
- :wiki:`WP:DIFFUSE`
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
update_options = {
diff --git a/scripts/category_graph.py b/scripts/category_graph.py
index 657e37f..0a8f8ab 100755
--- a/scripts/category_graph.py
+++ b/scripts/category_graph.py
@@ -40,7 +40,7 @@
fillcolor=green] edge[style=dashed penwidth=3]'
-.. version-added:: 8.0
+.. versionadded:: 8.0
"""
#
# (C) Pywikibot team, 2022-2025
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index b02088f..fc4e0cc 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -35,7 +35,7 @@
can be set within a settings file which is scripts.ini by default.
"""
#
-# (C) Pywikibot team, 2008-2025
+# (C) Pywikibot team, 2008-2023
#
# Distributed under the terms of the MIT license.
#
@@ -79,10 +79,10 @@
"""Page category update bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CategoryRedirectBot is a ConfigParserBot
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
A logentry is written to <userpage>/category_edit_requests if a
page cannot be moved
"""
diff --git a/scripts/change_pagelang.py b/scripts/change_pagelang.py
index d9ef29e..bedd622 100755
--- a/scripts/change_pagelang.py
+++ b/scripts/change_pagelang.py
@@ -20,7 +20,7 @@
.. note:: This script is a
:class:`ConfigParserBot<bot.ConfigParserBot>`. All options can be set
within a settings file which is scripts.ini by default.
-.. version-added:: 5.1
+.. versionadded:: 5.1
"""
#
# (C) Pywikibot team, 2018-2025
@@ -43,7 +43,7 @@
"""Change page language bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
ChangeLangBot is a ConfigParserBot
"""
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index a1a8c56..e578550 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -71,7 +71,7 @@
Text= This is the template that the bot will use when it will
report the image's problem.
-.. version-changed:: 8.4
+.. versionchanged:: 8.4
Welcome messages are imported from :mod:`scripts.welcome` script.
"""
#
@@ -410,7 +410,7 @@
CATEGORIES_WITH_LICENSES = 'Q4481876', 'Q7451504'
"""Category items with the licenses; subcategories may contain other licenses.
-.. version-changed:: 7.2
+.. versionchanged:: 7.2
uses wikibase items instead of category titles.
"""
@@ -782,7 +782,7 @@
) -> pywikibot.FilePage:
"""Get tuples of image and time, return the most used or oldest image.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
itertools.zip_longest is used to stop `using_pages` as soon as
possible.
@@ -1105,7 +1105,7 @@
def load_licenses(self) -> set[pywikibot.Page]:
"""Load the list of the licenses.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
return a set instead of a list for quicker lookup.
"""
pywikibot.info('\nLoading the allowed licenses...\n')
diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index 233b653..67bdca9 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -53,13 +53,13 @@
python pwb.py commons_information -start:File:!
-.. version-added:: 6.0
-.. version-changed:: 9.2
+.. versionadded:: 6.0
+.. versionchanged:: 9.2
accelerate script with preloading pages; use ``commons`` as default
site; use transcluded pages of ``Information`` template.
"""
#
-# (C) Pywikibot team, 2015-2025
+# (C) Pywikibot team, 2015-2024
#
# Distributed under the terms of the MIT license.
#
@@ -190,7 +190,7 @@
Combine all nodes and replace the last with new created
Template while removing the remaining from *wikicode*.
- .. version-added:: 9.2
+ .. versionadded:: 9.2
:param wikicode: The Wikicode of the parsed page text.
:param nodes: wikitext nodes to be processed
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 3a5ab19..b89ab6b 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -240,7 +240,7 @@
"""Commons categorisation bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CommonscatBot is a ConfigParserBot
"""
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 1f1eb7e..aaba65d 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -42,7 +42,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2013-2025
+# (C) Pywikibot team, 2013-2024
#
# Distributed under the terms of MIT license.
#
@@ -61,7 +61,7 @@
"""A bot to import coordinates to Wikidata.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CoordImportRobot is a ConfigParserBot
"""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index e314e77..346d721 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -31,7 +31,7 @@
For further information see pywikibot/cosmetic_changes.py
"""
#
-# (C) Pywikibot team, 2006-2025
+# (C) Pywikibot team, 2006-2022
#
# Distributed under the terms of the MIT license.
#
@@ -71,7 +71,7 @@
def treat_page(self) -> None:
"""Treat page with the cosmetic toolkit.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
skip if InvalidPageError is raised
"""
cc_toolkit = CosmeticChangesToolkit(self.current_page,
diff --git a/scripts/delinker.py b/scripts/delinker.py
index 4645151..9357bee 100755
--- a/scripts/delinker.py
+++ b/scripts/delinker.py
@@ -30,9 +30,9 @@
don't want the default values you can add any option you want to
change to that settings file below the [delinker] section like.
-.. version-added:: 7.2
+.. versionadded:: 7.2
This script is completely rewritten from compat branch.
-.. version-changed:: 9.4
+.. versionchanged:: 9.4
*-category* option was added.
"""
#
diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index c09070d..845520e 100755
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -57,7 +57,7 @@
Works only on sites with Proofread Page extension installed.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/download_dump.py b/scripts/download_dump.py
index f79f7d3..6436b93 100755
--- a/scripts/download_dump.py
+++ b/scripts/download_dump.py
@@ -13,10 +13,10 @@
.. note:: This script is a
:class:`ConfigParserBot<bot.ConfigParserBot>`. All options can be set
within a settings file which is scripts.ini by default.
-.. version-added:: 3.0.20180108
+.. versionadded:: 3.0.20180108
"""
#
-# (C) Pywikibot team, 2017-2025
+# (C) Pywikibot team, 2017-2024
#
# Distributed under the terms of the MIT license.
#
@@ -36,7 +36,7 @@
"""Download dump bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
DownloadDumpBot is a ConfigParserBot
"""
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 02bf72f..9ac823e 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -105,7 +105,7 @@
.. note:: This script is a
:py:obj:`ConfigParserBot <bot.ConfigParserBot>`. All options
can be set within a settings file which is scripts.ini by default.
-.. version-added:: 7.5
+.. versionadded:: 7.5
the -inverse option.
"""
#
@@ -168,7 +168,7 @@
"""A bot to add Wikidata claims.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
HarvestRobot is a ConfigParserBot
"""
@@ -242,7 +242,7 @@
link_text: str) -> pywikibot.ItemPage | None:
"""Find the ItemPage target for a given link text.
- .. version-changed:: 7.5
+ .. versionchanged:: 7.5
Only follow the redirect target if redirect page has no
wikibase item.
"""
@@ -323,7 +323,7 @@
field_item: tuple[str, str]) -> None:
"""Process a single field of template fielddict.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
field, value = field_item
field = field.strip()
@@ -387,7 +387,7 @@
) -> Generator[pywikibot.ItemPage]:
"""Handle 'wikibase-item' claim type.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
value = value.replace('{{!}}', '|')
prop, options = self.fields[field]
@@ -418,7 +418,7 @@
*args) -> Generator[WbTime]:
"""Handle 'time' claim type.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
value = value.replace('{{!}}', '|')
value = value.replace(' ', ' ')
@@ -472,7 +472,7 @@
def handle_string(value: str, *args) -> Generator[str]:
"""Handle 'string' and 'external-id' claim type.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
yield value.strip()
@@ -481,7 +481,7 @@
def handle_url(self, value, *args) -> Generator[str]:
"""Handle 'url' claim type.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
for match in self.linkR.finditer(value):
yield match['url']
@@ -494,7 +494,7 @@
) -> Generator[pywikibot.FilePage]:
"""Handle 'commonsMedia' claim type.
- .. version-added:: 7.5
+ .. versionadded:: 7.5
"""
repo = site.image_repository()
image = pywikibot.FilePage(repo, value)
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 1ea8116..200a083 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -342,7 +342,7 @@
``-start:!``, and if it takes so long that you have to break it off, use
``-continue`` next time.
-.. version-changed:: 10.4
+.. versionchanged:: 10.4
The ``-localonly`` option now restricts page processing to the
default site only, instead of the origin page.
"""
@@ -683,7 +683,7 @@
def is_not_redirect(page):
"""Check whether *page* is not a redirect page.
- .. version-added:: 11.0
+ .. versionadded:: 11.0
"""
return page.exists() and not (page.isRedirectPage()
or page.isCategoryRedirect())
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index abd1f7a..97da3df 100755
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -30,7 +30,7 @@
default.
"""
-# (C) Pywikibot team, 2015-2025
+# (C) Pywikibot team, 2015-2024
#
# Distributed under the terms of the MIT license.
#
@@ -59,7 +59,7 @@
"""The bot for interwiki.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
IWBot is a ConfigParserBot
"""
diff --git a/scripts/maintenance/__init__.py b/scripts/maintenance/__init__.py
index d51bb79..f6932d9 100644
--- a/scripts/maintenance/__init__.py
+++ b/scripts/maintenance/__init__.py
@@ -1,15 +1,15 @@
"""Maintenance scripts.
-.. version-removed:: 3.0.20190430
+.. versionremoved:: 3.0.20190430
``diff_checker`` script was removed (:phab:`T221462`).
-.. version-removed:: 6.1
+.. versionremoved:: 6.1
``compat2core`` script was removed.
-.. version-removed:: 7.3
+.. versionremoved:: 7.3
``update_linktrails`` script (:phab:`T89451`) and ``update_script``
script were removed.
-.. version-removed:: 8.0
+.. versionremoved:: 8.0
``sorting_order`` script was removed (:phab:`T325426`).
-.. version-removed:: 9.0
+.. versionremoved:: 9.0
``wikimedia_sites`` script was removed (:phab:`T78396`).
"""
from __future__ import annotations
diff --git a/scripts/maintenance/addwikis.py b/scripts/maintenance/addwikis.py
index 86e2606..501b8f7 100755
--- a/scripts/maintenance/addwikis.py
+++ b/scripts/maintenance/addwikis.py
@@ -14,12 +14,12 @@
and ``baz`` to wikisource.
-.. version-added:: 9.2
-.. version-changed:: 10.4
+.. versionadded:: 9.2
+.. versionchanged:: 10.4
The options ``-h``, ``-help`` and ``--help`` display the help message.
-.. version-deprecated:: 10.4
+.. deprecated:: 10.4
The ``help`` option
-.. version-changed:: 11.0
+.. versionchanged:: 11.0
Multiple families can be given with one run.
"""
#
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index fbb2d97..9cc42af 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -63,7 +63,7 @@
uniquedesc(entry)
"""
#
-# (C) Pywikibot team, 2014-2025
+# (C) Pywikibot team, 2014-2024
#
# Distributed under the terms of the MIT license.
#
@@ -116,7 +116,7 @@
def _get_cache_dir(self) -> Path:
"""Directory of the cached entry.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
return a `pathlib.Path` object.
"""
return Path(self.directory)
@@ -124,7 +124,7 @@
def _cachefile_path(self) -> Path:
"""Return cache file path.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
return a `pathlib.Path` object.
"""
return self._get_cache_dir() / self._create_file_name()
@@ -229,7 +229,7 @@
check the filesystem mount options. You may need to remount with
'strictatime'.
- .. version-changed:: 9.0
+ .. versionchanged:: 9.0
default cache path to 'apicache' without Python main version.
:param use_accesstime: Whether access times should be used. `None`
diff --git a/scripts/maintenance/unidata.py b/scripts/maintenance/unidata.py
index 1adee27..096a600 100755
--- a/scripts/maintenance/unidata.py
+++ b/scripts/maintenance/unidata.py
@@ -7,10 +7,10 @@
a superse of the older version and should be enough. But this is not
tested completely.
-.. version-added:: 8.4
+.. versionadded:: 8.4
"""
#
-# (C) Pywikibot team, 2018-2025
+# (C) Pywikibot team, 2018-2024
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 5d2b50a..0850b4f 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -36,7 +36,7 @@
``-pairsfile:filename``
"""
#
-# (C) Pywikibot team, 2006-2025
+# (C) Pywikibot team, 2006-2024
#
# Distributed under the terms of the MIT license.
#
@@ -61,7 +61,7 @@
"""Page move bot.
- .. version-changed:: 7.2
+ .. versionchanged:: 7.2
`movesubpages` option was added
"""
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index 5733e3e..33d6fc0 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -763,7 +763,7 @@
ident: str = '==') -> str:
"""Create a reference section and insert it into the given text.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
raise :exc:`exceptions.TranslationError` if script is not
localized for the current site.
@@ -802,7 +802,7 @@
def treat_page(self) -> None:
"""Run the bot.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
print error message and close :attr:`bot.BaseBot.generator`
if :exc:`exceptions.TranslationError` was raised.
"""
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index c97a5ab..cab5ff4 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -42,7 +42,7 @@
can be set within a settings file which is scripts.ini by default.
"""
#
-# (C) Pywikibot team, 2006-2025
+# (C) Pywikibot team, 2006-2024
#
# Distributed under the terms of the MIT license.
#
@@ -187,7 +187,7 @@
"""Bot to delete migrated files.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
NowCommonsDeleteBot is a ConfigParserBot
"""
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 4ef6844..5f31b5c 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -99,7 +99,7 @@
def __init__(self, offset: int, source: str | None = None) -> None:
"""Initializer.
- .. version-changed:: 10.7
+ .. versionchanged:: 10.7
*source* was added; a message was passed to Exception super
class.
"""
@@ -190,7 +190,7 @@
"""Generator class, responsible for reading the file.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
subclassed from :class:`pywikibot.tools.collections.GeneratorWrapper`
"""
@@ -236,7 +236,7 @@
content is stored as a page attribute defined by CTX_ATTR.
- .. version-changed:: 7.6
+ .. versionchanged:: 7.6
changed from iterator method to generator property
"""
pywikibot.info(f"\n\nReading '{self.filename}'...")
diff --git a/scripts/protect.py b/scripts/protect.py
index 79a1236..b462e7a 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -76,7 +76,7 @@
"""This bot allows protection of pages en masse.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/redirect.py b/scripts/redirect.py
index 3b69e46..f03d81b 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -21,7 +21,7 @@
deletion if there is no speedy deletion template
available.
- .. version-changed:: 10.3
+ .. versionchanged:: 10.3
only tries to fix if the namspace of the source page
is equal to the destination page.
@@ -238,7 +238,7 @@
) -> Generator[tuple[str, int | None, str, str | None]]:
r"""Return a generator that yields tuples of data about redirect Pages.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
only yield tuple if type of redirect is not 1 (normal redirect)
The description of returned tuple items is as follows:
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 294d07b..24edb1c 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -424,7 +424,7 @@
"""References bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
ReferencesRobot is a ConfigParserBot
"""
diff --git a/scripts/replace.py b/scripts/replace.py
index 0b5ccfd..cf32404 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -694,7 +694,7 @@
def treat(self, page) -> None:
"""Work on each page retrieved from generator.
- .. version-changed:: 10.1
+ .. versionchanged:: 10.1
After the browser call, the script affects the possibly
changed text.
"""
@@ -813,14 +813,14 @@
}
"""Dictionary to convert exceptions command line options to exceptions keys.
-.. version-added:: 7.0
+.. versionadded:: 7.0
"""
def handle_exceptions(*args: str) -> tuple[list[str], dict[str, str]]:
"""Handle exceptions args to ignore pages which contain certain texts.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
exceptions = {key: [] for key in EXC_KEYS.values()}
local_args = []
@@ -836,8 +836,8 @@
def handle_pairsfile(filename: str) -> list[str] | None:
"""Handle -pairsfile argument.
- .. version-added:: 7.0
- .. version-changed:: 9.2
+ .. versionadded:: 7.0
+ .. versionchanged:: 9.2
replacement patterns are printed it they are incomplete.
"""
if not filename:
@@ -865,7 +865,7 @@
def handle_manual() -> list[str]:
"""Handle manual input.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
pairs = []
old = pywikibot.input('Please enter the text that should be replaced:')
@@ -883,7 +883,7 @@
exceptions: list[re.Pattern]) -> Generator:
"""Handle default sql query.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
if not sql:
where_clause = 'WHERE ({})'.format(' OR '.join(
@@ -915,7 +915,7 @@
If args is an empty list, sys.argv is used.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
replacement patterns are printed it they are incomplete.
:param args: command line arguments
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index 69a3a4c..d0c0f90 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -101,7 +101,7 @@
def local_timestamp(self, ts) -> str:
"""Convert Timestamp to a localized timestamp string.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
"""
year = formatYear(self.site.lang, ts.year)
date = format_date(ts.month, ts.day, self.site)
diff --git a/scripts/touch.py b/scripts/touch.py
index 2e18424..b751a6d 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -23,7 +23,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2009-2025
+# (C) Pywikibot team, 2009-2024
#
# Distributed under the terms of the MIT license.
#
@@ -88,7 +88,7 @@
def treat(self, page) -> None:
"""Purge the given page.
- .. version-changed:: 8.0
+ .. versionchanged:: 8.0
Enable batch purge using :meth:`APISite.purgepages()
<pywikibot.site._apisite.APISite.purgepages>`
"""
@@ -100,7 +100,7 @@
def teardown(self) -> None:
"""Purge remaining pages if no KeyboardInterrupt was made.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
"""
if self.generator_completed:
with suppress(KeyboardInterrupt):
@@ -112,8 +112,8 @@
def purgepages(self, flush=False) -> None:
"""Purge a bulk of page if rate limit exceeded.
- .. version-added:: 8.0
- .. version-changed:: 9.0
+ .. versionadded:: 8.0
+ .. versionchanged:: 9.0
:meth:`site.APISite.ratelimit()
<pywikibot.site._apisite.APISite.ratelimit>` method is used
to determine bulk length and delay.
diff --git a/scripts/tracking_param_remover.py b/scripts/tracking_param_remover.py
index acdc13a..623f1cd 100755
--- a/scripts/tracking_param_remover.py
+++ b/scripts/tracking_param_remover.py
@@ -10,7 +10,7 @@
-always Don't prompt for each removal
-.. version-added:: 10.3
+.. versionadded:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/scripts/transwikiimport.py b/scripts/transwikiimport.py
index 32a6927..d3932ef 100755
--- a/scripts/transwikiimport.py
+++ b/scripts/transwikiimport.py
@@ -135,10 +135,10 @@
page the appropriate flag on the account must be set, usually
administrator, transwiki importer or importer.
-.. version-added:: 8.2
+.. versionadded:: 8.2
"""
#
-# (C) Pywikibot team, 2023-2025
+# (C) Pywikibot team, 2023-2024
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/unlink.py b/scripts/unlink.py
index 904942b..47d0a88 100755
--- a/scripts/unlink.py
+++ b/scripts/unlink.py
@@ -20,15 +20,15 @@
python pwb.py unlink "Foo bar" -namespace:0 -namespace:6
-.. version-changed:: 6.0
+.. versionchanged:: 6.0
script was archived.
-.. version-changed:: 7.0
+.. versionchanged:: 7.0
script was deleted.
-.. version-changed:: 9.4
+.. versionchanged:: 9.4
script was recovered.
"""
#
-# (C) Pywikibot team, 2007-2025
+# (C) Pywikibot team, 2007-2024
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index a071a10..d9309c0 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -20,7 +20,7 @@
-usertemplate: [str] Use a custom template to warn the uploader.
"""
#
-# (C) Pywikibot team, 2007-2025
+# (C) Pywikibot team, 2007-2024
#
# Distributed under the terms of the MIT license.
#
@@ -76,7 +76,7 @@
"""Unused files bot.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
UnusedFilesBot is a ConfigParserBot
"""
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index 5e6e8f4..b2fb03f 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -21,7 +21,7 @@
-new Load watchlists for all wikis where accounts is set in user
config file
-.. version-changed:: 7.7
+.. versionchanged:: 7.7
watchlist is retrieved in parallel tasks.
"""
#
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 2941c71..a39cab7 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -790,7 +790,7 @@
def skip_page(self, user) -> bool:
"""Check whether the user is to be skipped.
- .. version-changed:: 7.0
+ .. versionchanged:: 7.0
also skip if user is locked globally
"""
if user.is_blocked() or user.is_locked():
diff --git a/setup.py b/setup.py
index 51a6b39..19acf97 100755
--- a/setup.py
+++ b/setup.py
@@ -96,7 +96,7 @@
``configparser`` is used. Therefore the tomlfile must be readable as
config file until the first comment.
- .. version-added:: 9.0
+ .. versionadded:: 9.0
"""
if sys.version_info >= (3, 11):
import tomllib
diff --git a/tests/README.rst b/tests/README.rst
index 60c7ea9..503b397 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -136,7 +136,7 @@
write operations successfully. These **will** write to the wikis, and they
should always only write to 'test' wikis.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
Enabling them will also enable 'edit failure' tests which attempt to write
to the wikis and **should** fail. If there is a bug in pywikibot or
MediaWiki, these tests **may** actually perform a write operation.
@@ -145,10 +145,10 @@
PYWIKIBOT_TEST_WRITE=1
-.. version-removed:: 9.2
+.. versionremoved:: 9.2
The :envvar:`PYWIKIBOT_TEST_WRITE_FAIL` environment variable; use
:envvar:`PYWIKIBOT_TEST_WRITE` instead.
-.. version-removed:: 9.5
+.. versionremoved:: 9.5
The :envvar:`PYWIKIBOT_TEST_GUI` environment variable.
Instead of setting the environment by the os (or `os.environ` as well) you can use the :mod:`pwb`
diff --git a/tests/aspects.py b/tests/aspects.py
index c535aa9..6c8144e 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -73,7 +73,7 @@
The mixin will be removed without deprecation period once Python 3.14
becomes the minimum requirement for Pywikibot, likely with Pywikibot 16.
- .. version-added:: 10.3
+ .. versionadded:: 10.3
"""
def assertStartsWith(self, s: str, prefix: str,
@@ -292,7 +292,7 @@
) -> list[pywikibot.Page]:
"""Get pages from gen, asserting they are Page from site.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
the *count* parameter was dropped; all pages from *gen* are
tested.
@@ -339,7 +339,7 @@
skip: bool = False) -> None:
"""Try to confirm that generator returns Pages for all namespaces.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises TypeError instead of AssertionError
:param gen: generator to iterate
@@ -453,9 +453,9 @@
only supported for the current site — not for related sites like
data or image repositories.
- .. version-added:: 8.0
+ .. versionadded:: 8.0
- .. version-changed:: 10.0
+ .. versionchanged:: 10.0
TypeError and ValueError are used for validation fails.
*version_needed* parameter is positional only.
@@ -679,7 +679,7 @@
The test class is skipped unless environment variable
:envvar:`PYWIKIBOT_TEST_WRITE` is set to 1.
- .. version-changed:: 9.2
+ .. versionchanged:: 9.2
:envvar:`PYWIKIBOT_TEST_WRITE_FAIL` environment variable was
discarded, see :ref:`Environment variables`.
@@ -765,7 +765,7 @@
There may be many sites, and setUp doesn't know which site is to
be tested; ensure they are all logged in.
- .. version-added:: 7.0
+ .. versionadded:: 7.0
The `skip_if_login_fails` parameter.
:param skip_if_login_fails: called with setUp(); if True, skip
@@ -832,7 +832,7 @@
def __new__(cls, name, bases, dct):
"""Create the new class.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises AttributeError instead of AssertionError for
duplicated hostname, raises Exception instead of
AssertionError for missing or wrong "net" attribute with
@@ -1034,7 +1034,7 @@
def add_method(dct, test_name, method, doc=None, doc_suffix=None) -> None:
"""Set method's __name__ and __doc__ and add it to dct.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises ValueError instead of AssertionError
:raises ValueError: doc string must end with a period.
@@ -1115,7 +1115,7 @@
def get_site(cls, name=None):
"""Return the prefetched Site object.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises Exception instead of AssertionError for site mismatch
:raises Exception: method called for multiple sites without
@@ -1338,7 +1338,7 @@
Check that the default site is a Wikimedia site.
Use en.wikipedia.org as a fallback.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises Exception instead of AssertionError
:raises Exception: "site" or "sites" attribute is missing or
@@ -1498,7 +1498,7 @@
def execute(self, args: list[str], **kwargs):
"""Run :func:`tests.utils.execute_pwb` with default site.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
pass all arguments to :func:`tests.utils.execute_pwb`; make
this method public.
@@ -1583,7 +1583,7 @@
instead: str | bool | None) -> Any:
"""Build a deprecation warning result.
- .. version-changed:: 9.3
+ .. versionchanged:: 9.3
raises TypeError instead of AssertionError
:raises TypeError: invalid *instead* type
diff --git a/tests/basepage.py b/tests/basepage.py
index 504ac7a..a611768 100644
--- a/tests/basepage.py
+++ b/tests/basepage.py
@@ -16,7 +16,7 @@
"""Enable abstract methods in TestCase-based base classes.
- .. version-added:: 10.3
+ .. versionadded:: 10.3
"""
@@ -38,7 +38,7 @@
def setup_page(self) -> None:
"""Subclasses must implement this to assign self._page.
- .. version-added:: 10.3
+ .. versionadded:: 10.3
"""
diff --git a/tests/gui_tests.py b/tests/gui_tests.py
index 7a874af..9ff4a7d 100755
--- a/tests/gui_tests.py
+++ b/tests/gui_tests.py
@@ -61,10 +61,10 @@
def setUpModule() -> None:
"""Skip tests if tkinter or PIL is not installed.
- .. version-changed:: 7.7
+ .. versionchanged:: 7.7
skip test if ``PYWIKIBOT_TEST_GUI`` environment variable is not
set.
- .. version-changed:: 9.5
+ .. versionchanged:: 9.5
:envvar:`PYWIKIBOT_TEST_GUI` environment variable was removed.
``pytest`` with ``pytest-xvfb `` extension is required for this
tests on github actions.
diff --git a/tests/hooks/__init__.py b/tests/hooks/__init__.py
index c6b1b4b..b9e3b06 100644
--- a/tests/hooks/__init__.py
+++ b/tests/hooks/__init__.py
@@ -1,6 +1,6 @@
"""Local pre-commit hooks for CI tests.
-.. version-added:: 10.3
+.. versionadded:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/tests/hooks/copyright_fixer.py b/tests/hooks/copyright_fixer.py
index ccd108a..d3fa734 100755
--- a/tests/hooks/copyright_fixer.py
+++ b/tests/hooks/copyright_fixer.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""Pre-commit hook to set the leftmost copyright year.
-.. version-added:: 10.3
+.. versionadded:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/tests/pwb/print_argv.py b/tests/pwb/print_argv.py
index 0f8aa57..fd08973 100755
--- a/tests/pwb/print_argv.py
+++ b/tests/pwb/print_argv.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
"""Script that forms part of pwb_tests.
-.. version-added:: 7.0
+.. versionadded:: 7.0
"""
#
-# (C) Pywikibot team, 2021-2025
+# (C) Pywikibot team, 2021
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/superset_tests.py b/tests/superset_tests.py
index 68b6db8..7977f2f 100755
--- a/tests/superset_tests.py
+++ b/tests/superset_tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Tests for superset module.
-.. version-added:: 9.2
+.. versionadded:: 9.2
"""
#
# (C) Pywikibot team, 2024-2025
diff --git a/tests/utils.py b/tests/utils.py
index 1457ffa..afe9743 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -292,7 +292,7 @@
def is_cached(self, key: str) -> bool:
"""Return whether the key is cached.
- .. version-added:: 8.3
+ .. versionadded:: 8.3
"""
return key in self._cache
@@ -416,7 +416,7 @@
def login(self, *args, cookie_only=False, **kwargs) -> None:
"""Overwrite login which is called when a site is initialized.
- .. version-added:: 8.0.4
+ .. versionadded:: 8.0.4
"""
if cookie_only:
return
@@ -467,9 +467,9 @@
def execute(command: list[str], *, data_in=None, timeout=None):
"""Execute a command and capture outputs.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
*error* parameter was removed.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
parameters except *command* are keyword only.
:param command: executable to run and arguments to use
@@ -518,11 +518,11 @@
overrides: dict[str, str] | None = None) -> dict[str, Any]:
"""Execute the pwb.py script and capture outputs.
- .. version-changed:: 8.2
+ .. versionchanged:: 8.2
the *error* parameter was removed.
- .. version-changed:: 9.1
+ .. versionchanged:: 9.1
parameters except *args* are keyword only.
- .. version-changed:: 10.4
+ .. versionchanged:: 10.4
coverage is used if running github actions and a temporary file
is used for overrides.
@@ -612,8 +612,8 @@
.. note:: The last sample uses Python 3.10 syntax.
- .. version-added:: 6.2
- .. version-changed:: 9.3
+ .. versionadded:: 6.2
+ .. versionchanged:: 9.3
*code* parameter was added
:param exceptions: Exceptions to let test skip
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221614?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: If3fe53fb1240abb2668ba84c4085f47ea2a6e152
Gerrit-Change-Number: 1221614
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221594?usp=email )
Change subject: Revert^2 "doc: replace directives describing changes between versions"
......................................................................
Revert^2 "doc: replace directives describing changes between versions"
This reverts commit 762761d7f68653a495320ca592a347e74ad9cd8d.
Reason for revert: autodoc_use_legacy_class_based was activated
Bug: T413563
Change-Id: Id8d15264aa2990bed0765f389fea26d1d99fc6f2
---
M conftest.py
M docs/api_ref/family.rst
M docs/api_ref/pywikibot.site.rst
M docs/api_ref/tools/tools.itertools.rst
M docs/api_ref/tools/tools.threading.rst
M docs/conf.py
M docs/introduction.rst
M docs/scripts/archive.rst
M make_dist.py
M pwb.py
M pywikibot/__init__.py
M pywikibot/__metadata__.py
M pywikibot/_wbtypes.py
M pywikibot/backports.py
M pywikibot/bot.py
M pywikibot/bot_choice.py
M pywikibot/comms/eventstreams.py
M pywikibot/comms/http.py
M pywikibot/config.py
M pywikibot/cosmetic_changes.py
M pywikibot/daemonize.py
M pywikibot/data/__init__.py
M pywikibot/data/api/_generators.py
M pywikibot/data/api/_optionset.py
M pywikibot/data/api/_paraminfo.py
M pywikibot/data/api/_requests.py
M pywikibot/data/citoid.py
M pywikibot/data/memento.py
M pywikibot/data/sparql.py
M pywikibot/data/superset.py
M pywikibot/data/wikistats.py
M pywikibot/date.py
M pywikibot/diff.py
M pywikibot/echo.py
M pywikibot/editor.py
M pywikibot/exceptions.py
M pywikibot/families/commons_family.py
M pywikibot/families/foundation_family.py
M pywikibot/families/lingualibre_family.py
M pywikibot/families/wikifunctions_family.py
M pywikibot/families/wikihow_family.py
M pywikibot/families/wikimania_family.py
M pywikibot/families/wikipedia_family.py
M pywikibot/families/wikispore_family.py
M pywikibot/families/wiktionary_family.py
M pywikibot/families/wowwiki_family.py
M pywikibot/family.py
M pywikibot/fixes.py
M pywikibot/i18n.py
M pywikibot/logentries.py
M pywikibot/logging.py
M pywikibot/login.py
M pywikibot/page/_basepage.py
M pywikibot/page/_category.py
M pywikibot/page/_collections.py
M pywikibot/page/_filepage.py
M pywikibot/page/_links.py
M pywikibot/page/_page.py
M pywikibot/page/_toolforge.py
M pywikibot/page/_user.py
M pywikibot/page/_wikibase.py
M pywikibot/pagegenerators/__init__.py
M pywikibot/pagegenerators/_factory.py
M pywikibot/pagegenerators/_generators.py
M pywikibot/plural.py
M pywikibot/proofreadpage.py
M pywikibot/scripts/__init__.py
M pywikibot/scripts/generate_family_file.py
M pywikibot/scripts/generate_user_files.py
M pywikibot/scripts/login.py
M pywikibot/scripts/shell.py
M pywikibot/scripts/version.py
M pywikibot/scripts/wrapper.py
M pywikibot/site/_apisite.py
M pywikibot/site/_basesite.py
M pywikibot/site/_datasite.py
M pywikibot/site/_extensions.py
M pywikibot/site/_generators.py
M pywikibot/site/_namespace.py
M pywikibot/site/_siteinfo.py
M pywikibot/site/_tokenwallet.py
M pywikibot/site/_upload.py
M pywikibot/site_detect.py
M pywikibot/specialbots/_upload.py
M pywikibot/textlib.py
M pywikibot/throttle.py
M pywikibot/time.py
M pywikibot/titletranslate.py
M pywikibot/tools/__init__.py
M pywikibot/tools/_deprecate.py
M pywikibot/tools/chars.py
M pywikibot/tools/collections.py
M pywikibot/tools/formatter.py
M pywikibot/tools/itertools.py
M pywikibot/tools/threading.py
M pywikibot/userinterfaces/_interface_base.py
M pywikibot/userinterfaces/buffer_interface.py
M pywikibot/userinterfaces/terminal_interface_base.py
M pywikibot/userinterfaces/transliteration.py
M pywikibot/version.py
M pywikibot/xmlreader.py
M scripts/archivebot.py
M scripts/blockpageschecker.py
M scripts/category.py
M scripts/category_graph.py
M scripts/category_redirect.py
M scripts/change_pagelang.py
M scripts/checkimages.py
M scripts/commons_information.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/delinker.py
M scripts/djvutext.py
M scripts/download_dump.py
M scripts/harvest_template.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/maintenance/__init__.py
M scripts/maintenance/addwikis.py
M scripts/maintenance/cache.py
M scripts/maintenance/unidata.py
M scripts/movepages.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/protect.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/revertbot.py
M scripts/touch.py
M scripts/tracking_param_remover.py
M scripts/transwikiimport.py
M scripts/unlink.py
M scripts/unusedfiles.py
M scripts/watchlist.py
M scripts/welcome.py
M setup.py
M tests/README.rst
M tests/aspects.py
M tests/basepage.py
M tests/gui_tests.py
M tests/hooks/__init__.py
M tests/hooks/copyright_fixer.py
M tests/pwb/print_argv.py
M tests/superset_tests.py
M tests/utils.py
148 files changed, 890 insertions(+), 890 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/conftest.py b/conftest.py
index 544f800..4b7a46b 100644
--- a/conftest.py
+++ b/conftest.py
@@ -1,6 +1,6 @@
"""Configuration file for pytest.
-.. versionadded:: 10.3
+.. version-added:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/docs/api_ref/family.rst b/docs/api_ref/family.rst
index 314d96a..be07648 100644
--- a/docs/api_ref/family.rst
+++ b/docs/api_ref/family.rst
@@ -37,4 +37,4 @@
aliases['yue'] = 'zh-yue'
cls.code_aliases = aliases
- .. versionadded:: 8.3
+ .. version-added:: 8.3
diff --git a/docs/api_ref/pywikibot.site.rst b/docs/api_ref/pywikibot.site.rst
index 6fe32e4..82029bd 100644
--- a/docs/api_ref/pywikibot.site.rst
+++ b/docs/api_ref/pywikibot.site.rst
@@ -32,7 +32,7 @@
Return tuple of edit restricted templates.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
.. seealso:: :meth:`family.Family.get_edit_restricted_templates`
:rtype: tuple[str, ...]
@@ -42,7 +42,7 @@
Return tuple of edit restricted templates.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
.. seealso:: :meth:`family.Family.get_archived_page_templates`
:rtype: tuple[str, ...]
@@ -65,7 +65,7 @@
May be overridden to return 'http'. Other protocols are not
supported.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
``https`` is returned instead of ``http``.
.. seealso:: :meth:`family.Family.protocol`
@@ -107,11 +107,11 @@
Using *namespace* option different from ``0``
needs a lot of time on Wikidata site.
- .. deprecated:: 10.7
+ .. version-deprecated:: 10.7
This method is dysfunctional and should no longer be used. It
will be removed in Pywikibot 11.
- .. versionremoved:: 11.0
+ .. version-removed:: 11.0
This method was dysfunctional and removed, see the following tickets for details:
:phab:`T359427`, :phab:`T364617` and :phab:`T407708`
diff --git a/docs/api_ref/tools/tools.itertools.rst b/docs/api_ref/tools/tools.itertools.rst
index 9aa7746..64bc794 100644
--- a/docs/api_ref/tools/tools.itertools.rst
+++ b/docs/api_ref/tools/tools.itertools.rst
@@ -10,9 +10,9 @@
Make an iterator that returns lists of (up to) *size* items from *iterable*.
- .. versionadded:: 7.6
+ .. version-added:: 7.6
The *strict* parameter.
- .. deprecated:: 8.2
+ .. version-deprecated:: 8.2
Use :func:`backports.batched` instead.
- .. versionremoved:: 11.0
+ .. version-removed:: 11.0
This function was removed; use :pylib:`itertools.batched<itertools#itertools.batched>` instead.
diff --git a/docs/api_ref/tools/tools.threading.rst b/docs/api_ref/tools/tools.threading.rst
index c1ef728..5e8bd77 100644
--- a/docs/api_ref/tools/tools.threading.rst
+++ b/docs/api_ref/tools/tools.threading.rst
@@ -6,5 +6,5 @@
.. autoclass:: RLock
- .. deprecated:: 10.2
+ .. version-deprecated:: 10.2
use :mod:`backports.RLock` instead
diff --git a/docs/conf.py b/docs/conf.py
index f8b17b7..aa8d2f7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -515,7 +515,7 @@
def pywikibot_docstring_fixups(app, what, name, obj, options, lines) -> None:
"""Remove plain 'Initializer.' or 'Allocator.' docstring.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
remove 'Allocator.' docstring too.
"""
if what not in ('class', 'exception'):
diff --git a/docs/introduction.rst b/docs/introduction.rst
index 70bf537..de11f04 100644
--- a/docs/introduction.rst
+++ b/docs/introduction.rst
@@ -35,7 +35,7 @@
#. fallback is `'en'` for English if all other options fails
.. note:: The preferred language code must follow ISO 639.
-.. versionadded:: 7.0
+.. version-added:: 7.0
Added to site-package distribution
.. seealso::
* :manpage:`i18n` Manual
diff --git a/docs/scripts/archive.rst b/docs/scripts/archive.rst
index 9877db6..4481c24 100644
--- a/docs/scripts/archive.rst
+++ b/docs/scripts/archive.rst
@@ -70,7 +70,7 @@
amend the related Wikidata item for edition (with the
:samp:`P212, {ISBN number}` as unique external ID).
-.. versionremoved:: 11.0
+.. version-removed:: 11.0
An external version of this script can be found in the
`geertivp/Pywikibot <https://github.com/geertivp/Pywikibot>`_ script
collection. See :phab:`T398140` for details.
@@ -118,8 +118,8 @@
cases where a more precise and less precise value have both been
included.
-.. versionadded:: 7.2
-.. versionremoved:: 10.0
+.. version-added:: 7.2
+.. version-removed:: 10.0
disambredirs script
===================
diff --git a/make_dist.py b/make_dist.py
index 238928a..c910cea 100755
--- a/make_dist.py
+++ b/make_dist.py
@@ -27,28 +27,28 @@
[pwb] make_dist [repo] [options]
-.. versionadded:: 7.3
-.. versionchanged:: 7.4
+.. version-added:: 7.3
+.. version-changed:: 7.4
- updates pip, setuptools, wheel and twine packages first
- installs pre-releases over stable versions
- also creates built distribution together with source distribution
- *-upgrade* option was added
-.. versionchanged:: 7.5
+.. version-changed:: 7.5
- *clear* option was added
- *nodist* option was added
-.. versionchanged:: 8.1
+.. version-changed:: 8.1
*nodist* option was removed, *clear* option does not create a
distribution. *local* and *remote* option clears old distributions
first.
-.. versionchanged:: 8.2
+.. version-changed:: 8.2
Build frontend was changed from setuptools to build. ``-upgrade``
option also installs packages if necessary.
-.. versionchanged:: 9.4
+.. version-changed:: 9.4
The pywikibot-scripts distribution can be created.
"""
#
@@ -75,8 +75,8 @@
"""Setup distribution base class.
- .. versionadded:: 8.0
- .. versionchanged:: 8.1
+ .. version-added:: 8.0
+ .. version-changed:: 8.1
*dataclass* is used.
"""
@@ -95,7 +95,7 @@
def clear_old_dist(self) -> None: # pragma: no cover
"""Delete old dist folders.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
info('<<lightyellow>>Removing old dist folders... ', newline=False)
shutil.rmtree(self.folder / 'build', ignore_errors=True)
@@ -146,7 +146,7 @@
def build(self) -> bool: # pragma: no cover
"""Build the packages.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
"""
self.copy_files()
info('<<lightyellow>>Build package')
@@ -178,7 +178,7 @@
"""Setup for Pywikibot distribution.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
build_opt = '' # defaults to current directory
@@ -221,7 +221,7 @@
"""Setup pywikibot-scripts distribution.
- .. versionadded:: 9.4
+ .. version-added:: 9.4
"""
build_opt = '-w' # only wheel (yet)
diff --git a/pwb.py b/pwb.py
index e8c5ed6..b00bf9b 100755
--- a/pwb.py
+++ b/pwb.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""PWB caller script to invoke the :mod:`pywikibot.scripts.wrapper` script.
-.. versionadded:: 8.0
+.. version-added:: 8.0
"""
#
# (C) Pywikibot team, 2022-2025
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 7dc246a..2348823 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -170,16 +170,16 @@
.. warning:: Never create a site object via interface class directly.
Always use this factory method.
- .. versionchanged:: 5.6
+ .. version-changed:: 5.6
If a family file does not fit the given *url*, an
:class:`family.AutoFamily` is used to create the site.
- .. versionchanged:: 7.3
+ .. version-changed:: 7.3
Short creation if site code is equal to family name like
`Site('commons')`, `Site('meta')` or `Site('wikidata')`.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*url* does not have to contain an api, requests or script path
any longer.
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
accept a trailing slash in *url* after domain.
:param code: language code (override config.mylang)
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 8367f21..bfcef6c 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -1,6 +1,6 @@
"""Pywikibot metadata file.
-.. versionadded:: 4.0
+.. version-added:: 4.0
"""
#
# (C) Pywikibot team, 2020-2025
@@ -12,6 +12,6 @@
from time import strftime
-__version__ = '11.0.0.dev6'
+__version__ = '11.0.0.dev7'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
__copyright__ = f'2003-{strftime("%Y")}, Pywikibot team'
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index 6b6a189..bcfced3 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -79,7 +79,7 @@
def __repr__(self) -> str:
"""String representation of this object.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Parameters are shown as representations instead of plain
strings.
@@ -126,7 +126,7 @@
) -> None:
"""Represent a geo coordinate.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
The parameters after `lat` and `lon` are now keyword-only.
:param lat: Latitude coordinate
@@ -332,7 +332,7 @@
A successful lookup is stored as an internal value to avoid the
need for repeated lookups.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
The *lazy_load* parameter is now keyword-only.
:param repo: the Wikibase site for the globe, if different from
@@ -472,11 +472,11 @@
the equality operator will return false if the timezone is
different.
- .. deprecated:: 10.0
+ .. version-deprecated:: 10.0
*precision* value 'millenia' is deprecated; 'millennium' must
be used instead.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
The parameters except timestamp values are now keyword-only.
A TypeError is raised if *year* is not an int. Previously, a
ValueError was raised if *year* was None.
@@ -561,7 +561,7 @@
This value should *only* be used for comparisons, and its value
may change without warning.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
:return: An integer roughly representing the number of seconds
since January 1, 0000 AD, adjusted for leap years.
@@ -597,7 +597,7 @@
def __lt__(self, other: object) -> bool:
"""Compare if self is less than other.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() < other._getSecondsAdjusted()
@@ -606,7 +606,7 @@
def __le__(self, other: object) -> bool:
"""Compare if self is less equals other.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() <= other._getSecondsAdjusted()
@@ -615,7 +615,7 @@
def __gt__(self, other: object) -> bool:
"""Compare if self is greater than other.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() > other._getSecondsAdjusted()
@@ -624,7 +624,7 @@
def __ge__(self, other: object) -> bool:
"""Compare if self is greater equals other.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
if isinstance(other, WbTime):
return self._getSecondsAdjusted() >= other._getSecondsAdjusted()
@@ -641,7 +641,7 @@
with == with a time at 15:00 UTC, but would return true with
this method.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
return self._getSecondsAdjusted() == other._getSecondsAdjusted()
@@ -669,7 +669,7 @@
- Time is always in UTC and ends with ``Z``.
- Example: ``+0000000000123456-01-01T00:00:00Z``.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
The parameters except *datetimestr* are now keyword-only.
:param datetimestr: Timestamp string to parse
@@ -713,9 +713,9 @@
) -> WbTime:
"""Create a new WbTime object from a pywikibot.Timestamp.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Added *copy_timezone* parameter.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
The parameters except *timestamp* are now keyword-only.
@@ -749,7 +749,7 @@
The rounding is performed towards positive infinity for positive
years and towards negative infinity for negative years.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param year: The year as an integer.
:return: The first year of the millennium containing the given
@@ -772,7 +772,7 @@
The rounding is performed towards positive infinity for positive
years and towards negative infinity for negative years.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param year: The year as an integer.
:return: The first year of the century containing the given year.
@@ -793,7 +793,7 @@
Unlike millennium or century normalization, this always
truncates towards zero.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param year: The year as an integer.
:return: The first year of the decade containing the given year.
@@ -811,7 +811,7 @@
This is used for very coarse historical precision levels, where
the time unit represents a power-of-ten number of years.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param year: The year as an integer.
:param precision: The precision level (Wikibase int value).
@@ -879,9 +879,9 @@
.. seealso:: :meth:`fromTimestr` for differences between output
with and without *force_iso* parameter.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*normalize* parameter was added.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*normalize* parameter was removed due to :phab:`T340495` and
:phab:`T57755`
@@ -898,7 +898,7 @@
def toTimestamp(self, timezone_aware: bool = False) -> Timestamp:
"""Convert the data to a pywikibot.Timestamp.
- .. versionchanged:: 8.0.1
+ .. version-changed:: 8.0.1
*timezone_aware* parameter was added.
:param timezone_aware: Whether the timezone should be passed to
@@ -918,9 +918,9 @@
def toWikibase(self) -> dict[str, Any]:
"""Convert the data to a JSON object for the Wikibase API.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*normalize* parameter was added.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*normalize* parameter was removed due to :phab:`T340495` and
:phab:`T57755`
@@ -1304,8 +1304,8 @@
This data type is just a json container
- .. versionadded:: 3.0
- .. versionchanged:: 9.4
+ .. version-added:: 3.0
+ .. version-changed:: 9.4
*warning* parameter was added
"""
@@ -1324,7 +1324,7 @@
def toWikibase(self) -> dict[str, Any]:
"""Return the JSON object for the Wikibase API.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
a waning message given by the warning attribute is shown once.
:return: Wikibase JSON
diff --git a/pywikibot/backports.py b/pywikibot/backports.py
index 5936ab7..e3e40c1 100644
--- a/pywikibot/backports.py
+++ b/pywikibot/backports.py
@@ -4,7 +4,7 @@
Breaking changes may be made at any time, and the module is not
subject to deprecation requirements.
-.. versionchanged:: 10.0
+.. version-changed:: 10.0
This module is 'private'.
"""
#
@@ -36,7 +36,7 @@
.. seealso:: :python:`itertools.pairwise
<library/itertools.html#itertools.pairwise>`,
backported from Python 3.10.
- .. versionadded:: 7.6
+ .. version-added:: 7.6
"""
a, b = tee(iterable)
next(b, None)
@@ -81,8 +81,8 @@
.. seealso:: :python:`itertools.batched
<library/itertools.html#itertools.batched>`,
backported from Python 3.12.
- .. versionadded:: 8.2
- .. versionchanged:: 9.0
+ .. version-added:: 8.2
+ .. version-changed:: 9.0
Added *strict* option, backported from Python 3.13
:param n: How many items of the iterable to get in one chunk
@@ -148,8 +148,8 @@
>>> lock.locked()
False
- .. versionadded:: 6.2
- .. versionchanged:: 10.2
+ .. version-added:: 6.2
+ .. version-changed:: 10.2
moved from :mod:`tools.threading` to :mod:`backports`.
.. note:: Passing any arguments has no effect and has been
deprecated since Python 3.14 and was removed in Python 3.15.
@@ -187,7 +187,7 @@
def count(self):
"""Return number of acquired locks.
- .. deprecated:: 10.2
+ .. version-deprecated:: 10.2
"""
with self._block:
counter = re.search(r'count=(\d+) ', repr(self))
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 4a435ea..5286743 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -55,7 +55,7 @@
subclasses :class:`CurrentPageBot` and automatically defines the summary
when :meth:`put_current` is used.
-.. deprecated:: 9.2
+.. version-deprecated:: 9.2
The functions
:func:`critical()<pywikibot.logging.critical>`
:func:`debug()<pywikibot.logging.debug>`
@@ -74,7 +74,7 @@
within this module. Import them directly. These functions can also be
used as :mod:`pywikibot` members.
-.. versionremoved:: 10.0
+.. version-removed:: 10.0
The bot classes :class:`RedirectPageBot` and
:class:`NoRedirectPageBot` are deprecated. Use
:attr:`use_redirects<BaseBot.use_redirects>` attribute instead.
@@ -291,7 +291,7 @@
Calls :func:`init_handlers` to re-initialize if we were already
initialized with another UI.
- .. versionadded:: 6.4
+ .. version-added:: 6.4
"""
global ui
@@ -322,7 +322,7 @@
>>> handler_namer('add_text.log.1')
'add_text.1.log'
- .. versionadded:: 6.5
+ .. version-added:: 6.5
"""
path, qualifier = name.rsplit('.', 1)
root, ext = os.path.splitext(path)
@@ -369,7 +369,7 @@
use :func:`pywikibot.info()<pywikibot.logging.info>` function and
other functions from :mod:`pywikibot.logging` module.
- .. versionchanged:: 6.2
+ .. version-changed:: 6.2
Different logfiles are used if multiple processes of the same
script are running.
"""
@@ -468,7 +468,7 @@
This may help the user to track errors or report bugs.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
ignore milliseconds with timestamp.
"""
_log(f'\n=== Pywikibot framework v{pywikibot.__version__} --'
@@ -541,7 +541,7 @@
def initialize_handlers(function):
"""Make sure logging system has been initialized.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
@wraps(function)
def wrapper(*args, **kwargs):
@@ -670,7 +670,7 @@
docstring and because the module name will be used for the filename
of the log.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
Detect unittest and pytest run and return the test module.
"""
mod = pywikibot.argvu[0]
@@ -724,17 +724,17 @@
be used even if the `handle_args` method is used within the
script.
- .. versionchanged:: 5.2
+ .. version-changed:: 5.2
*-site* global option was added
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
*-cosmetic_changes* and *-cc* may be set directly instead of
toggling the value. Refer :func:`tools.strtobool` for valid values.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
*-config* global option was added.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Short site value can be given if site code is equal to family
like ``-site:meta``.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
``-nolog`` option also discards command.log.
:param args: Command line arguments. If None,
@@ -879,9 +879,9 @@
show_global: bool = False) -> None:
"""Show help for the Bot.
- .. versionchanged:: 4.0
+ .. version-changed:: 4.0
Renamed from showHelp() to show_help().
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Do not show version changes.
"""
if not module_name:
@@ -987,7 +987,7 @@
def open_webbrowser(page: pywikibot.page.BasePage) -> None:
"""Open the web browser displaying the page and wait for input.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
No longer follow a redirect.
"""
webbrowser.open(f'{page.full_url()}?redirect=no')
@@ -998,7 +998,7 @@
"""The option dict which holds the options of OptionHandler.
- .. versionadded:: 4.1
+ .. version-added:: 4.1
"""
def __init__(self, classname: str, options: dict[str, Any]) -> None:
@@ -1118,7 +1118,7 @@
For bot options handling refer :class:`OptionHandler` class above.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
A :attr:`counter` instance variable is provided.
"""
@@ -1127,7 +1127,7 @@
True to use disambigs only, set it to False to skip disambigs. If None both
are processed.
- .. versionadded:: 7.2
+ .. version-added:: 7.2
"""
use_redirects: bool | None = None
@@ -1144,7 +1144,7 @@
use_redirects = True
- .. versionadded:: 7.2
+ .. version-added:: 7.2
"""
available_options = {
@@ -1156,7 +1156,7 @@
use it if the bot class is to be derived but use
`self.available_options.update(<dict>)` initializer in such case.
- .. versionadded:: 6.4
+ .. version-added:: 6.4
"""
_current_page: pywikibot.page.BasePage | None = None
@@ -1185,8 +1185,8 @@
self.counter['delete'] += 1
- .. versionadded:: 7.0
- .. versionchanged:: 7.3
+ .. version-added:: 7.0
+ .. version-changed:: 7.3
Your additional counters are also printed during :meth:`exit`
"""
@@ -1205,15 +1205,15 @@
print('generator was emtpty')
.. note:: An empty generator returns True.
- .. versionadded:: 3.0
- .. versionchanged:: 7.4
+ .. version-added:: 3.0
+ .. version-changed:: 7.4
renamed to `generator_completed` to become a public attribute.
"""
self.treat_page_type: Any = pywikibot.page.BasePage
"""Instance variable to hold the default page type used by :meth:`run`.
- .. versionadded:: 6.1
+ .. version-added:: 6.1
"""
@property
@@ -1373,9 +1373,9 @@
.. note:: Do not overwrite it by subclasses; :meth:`teardown`
should be used instead.
- .. versionchanged:: 7.3
+ .. version-changed:: 7.3
Statistics are printed for all entries in :attr:`counter`
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Print execution time with days, hours, minutes and seconds.
"""
self.teardown()
@@ -1438,9 +1438,9 @@
def skip_page(self, page: pywikibot.page.BasePage) -> bool:
"""Return whether treat should be skipped for the page.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
use :attr:`use_redirects` to handle redirects,
use :attr:`use_disambigs` to handle disambigs
@@ -1482,13 +1482,13 @@
Invoked by :meth:`run` before running through :attr:`generator`
loop.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def teardown(self) -> None:
"""Some cleanups after :meth:`run` operation. Invoked by :meth:`exit`.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def run(self) -> None:
@@ -1534,16 +1534,16 @@
finally:
self.exit()
- .. versionchanged:: 3.0
+ .. version-changed:: 3.0
``skip`` counter was added.; call :meth:`setup` first.
- .. versionchanged:: 6.0
+ .. version-changed:: 6.0
upcast :attr:`generator` to a ``Generator`` type to enable
``generator.close()`` method.
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
Objects from :attr:`generator` may be different from
:class:`pywikibot.Page` but the type must be registered in
:attr:`treat_page_type`.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
leave method gracefully if :attr:`generator` is None using
:func:`suggest_help` function.
@@ -1759,7 +1759,7 @@
The bot should accommodate for that case and not store site specific
information on only one site.
- .. versionchanged:: 6.2
+ .. version-changed:: 6.2
Site attribute has been dropped.
"""
@@ -1786,7 +1786,7 @@
2. `script.ini options` settings
3. command line arguments
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
INI = 'scripts.ini'
@@ -1916,7 +1916,7 @@
For parameters see :meth:`CurrentPageBot.put_current`
- .. versionchanged:: 10.6
+ .. version-changed:: 10.6
return whether the page was saved successfully
"""
if not kwargs.get('summary'):
diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py
index eaa78f0..0a3c7aa 100644
--- a/pywikibot/bot_choice.py
+++ b/pywikibot/bot_choice.py
@@ -115,7 +115,7 @@
def result(self, value: str) -> Any:
"""Return the actual value which is associated by the given one.
- .. versionadded:: 6.2
+ .. version-added:: 6.2
*result()* is an abstract method and must be defined in
subclasses
"""
@@ -156,7 +156,7 @@
<userinterfaces._interface_base.ABUIC.input_choice>`
instead of deprecated :meth:`output`.
- .. versionadded:: 6.2
+ .. version-added:: 6.2
"""
return ''
@@ -508,7 +508,7 @@
"""An option to show a list and select an item.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
before_question = True
@@ -548,7 +548,7 @@
"""An option to select multiple items from a list.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def test(self, value: str) -> bool:
@@ -579,7 +579,7 @@
"""An option to show a list and select multiple items.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 8ab71b6..651a3c7 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -6,8 +6,8 @@
pip install "requests-sse>=0.5.0"
-.. versionadded:: 3.0
-.. versionchanged:: 10.0
+.. version-added:: 3.0
+.. version-changed:: 10.0
``requests-sse`` package is required instead of ``sseclient``.
"""
#
@@ -110,9 +110,9 @@
'wiki': 'wikidatawiki'}
>>> del stream
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*retry* value is doubled for each consecutive connect try.
"""
@@ -129,7 +129,7 @@
by including a 'retry' line in a message. Retries are handled
automatically.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
5 seconds are used instead of 3 seconds as default.
:keyword pywikibot.Timestamp | str since: a timestamp for older
@@ -162,7 +162,7 @@
:keyword int chunk_size: [*requests*] A maximum size of the chunk
for chunk-encoded requests.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
None is used instead of 1024 as default value.
:param kwargs: Other keyword arguments passed to `requests_sse`
@@ -373,7 +373,7 @@
def generator(self):
"""Inner generator.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
changed from iterator method to generator property
"""
n = 0
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 281cf16..7ed7ccd 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -21,7 +21,7 @@
session.cookies = http.cookie_jar
-.. versionchanged:: 8.0
+.. version-changed:: 8.0
Cookies are lazy loaded when logging to site.
"""
#
@@ -67,8 +67,8 @@
"""CookieJar which create the filename and checks file permissions.
- .. versionadded:: 8.0
- .. versionchanged:: 10.2
+ .. version-added:: 8.0
+ .. version-changed:: 10.2
use `threading.Lock` in :meth:`load` and :meth`save` to be thread
safe.
"""
@@ -119,7 +119,7 @@
def flush() -> None: # pragma: no cover
"""Close the session object. This is called when the module terminates.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
log the traceback and show the exception value in the critical
message
"""
@@ -264,7 +264,7 @@
The optional uri is a relative uri from site base uri including the
document root '/'.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
a *protocol* parameter can be given which is passed to the
:meth:`family.Family.base_url` method.
@@ -472,7 +472,7 @@
def get_charset_from_content_type(content_type: str) -> str | None:
"""Get charset from the content-type header.
- .. versionadded:: 7.3
+ .. version-added:: 7.3
"""
m = CHARSET_RE.search(content_type)
if not m:
@@ -522,7 +522,7 @@
charset: str | None = None) -> str | None:
"""Detect the response encoding.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
retrieve charset from `Accept-Charset` list which may look like
`'ISO-8859-1,utf-8;q=0.7,*;q=0.7'`.
diff --git a/pywikibot/config.py b/pywikibot/config.py
index 191d637..74bc950 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -26,9 +26,9 @@
- datafilepath
- shortpath
-.. versionchanged:: 6.2
+.. version-changed:: 6.2
config2 was renamed to config
-.. versionchanged:: 8.0
+.. version-changed:: 8.0
Editor settings has been revised. *editor* variable is None by
default. Editor detection functions were moved to :mod:`editor`.
"""
@@ -281,7 +281,7 @@
def get_user_config_file() -> str:
"""Return user config file name.
- .. versionadded:: 7.7
+ .. version-added:: 7.7
"""
for arg in sys.argv[1:]:
opt, _, value = arg.partition(':')
@@ -313,7 +313,7 @@
Set `PYWIKIBOT_NO_USER_CONFIG=1` to disable loading user config file
(`user-config.py`) or install Pywikibot as a site-package.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
Added the *config_file* parameter.
:param test_directory: Assume that a user config file exists in this
@@ -415,7 +415,7 @@
not_exists_ok: bool = False) -> None:
"""Register all family class files contained in a directory.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
The *not_exists_ok* parameter
:param folder_path: The path of a folder containing family files.
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index eb67d07..95e3d73 100644
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -179,7 +179,7 @@
order. This dict is used in
:meth:`CosmeticChangesToolkit.standardizePageFooter`.
-.. versionadded:: 9.3
+.. version-added:: 9.3
"""
@@ -190,7 +190,7 @@
If an error occurred and either skips the page or the method
or a single match. ALL raises the exception.
- .. versionadded:: 6.3
+ .. version-added:: 6.3
"""
ALL = 0
@@ -230,7 +230,7 @@
"""Cosmetic changes toolkit.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
`from_page()` method was removed
"""
@@ -239,12 +239,12 @@
ignore: IntEnum = CANCEL.ALL) -> None:
"""Initializer.
- .. versionchanged:: 5.2
+ .. version-changed:: 5.2
instantiate the CosmeticChangesToolkit from a page object;
only allow keyword arguments except for page parameter;
`namespace` and `pageTitle` parameters are deprecated
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
`namespace` and `pageTitle` parameters were removed
:param page: the Page object containing the text to be modified
@@ -349,7 +349,7 @@
2. additional information depending on the local site policy
3. interwiki
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
uses :attr:`main_sortkey` to determine the sort key for the
main article within a category. If the main article has a
sort key already, it will not be changed any longer.
@@ -415,7 +415,7 @@
def translateAndCapitalizeNamespaces(self, text: str) -> str:
"""Use localized namespace names.
- .. versionchanged:: 7.4
+ .. version-changed:: 7.4
No longer expect a specific namespace alias for File:
"""
# arz uses English stylish codes
@@ -546,7 +546,7 @@
without using a pipe, if possible
* Capitalize the article title of the link, if appropriate
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
Convert URL-encoded characters if a link is an interwiki link
or different from main namespace.
diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py
index a00c131..48004a8 100644
--- a/pywikibot/daemonize.py
+++ b/pywikibot/daemonize.py
@@ -89,7 +89,7 @@
Only works on POSIX compatible operating systems. The process will
fork to the background and return control to terminal.
- .. versionchanged:: 10.6
+ .. version-changed:: 10.6
raises NotImplementedError instead of AttributeError if daemonize
is not available for the given platform. Parameters must be given
as keyword-only arguments.
diff --git a/pywikibot/data/__init__.py b/pywikibot/data/__init__.py
index ce04a42..6c5e1ae 100644
--- a/pywikibot/data/__init__.py
+++ b/pywikibot/data/__init__.py
@@ -1,6 +1,6 @@
"""Module providing several layers of data access to the wiki."""
#
-# (C) Pywikibot team, 2007-2023
+# (C) Pywikibot team, 2007-2025
#
# Distributed under the terms of the MIT license.
#
@@ -13,7 +13,7 @@
"""A mixin to implement wait cycles.
- .. versionadded:: 8.4
+ .. version-added:: 8.4
:ivar int max_retries: Maximum number of times to retry an API
request before quitting. Defaults to ``config.max_retries`` if
diff --git a/pywikibot/data/api/_generators.py b/pywikibot/data/api/_generators.py
index 4f6297f..b2ff049 100644
--- a/pywikibot/data/api/_generators.py
+++ b/pywikibot/data/api/_generators.py
@@ -1,6 +1,6 @@
"""Objects representing API/Query generators.
-.. versionchanged:: 7.6
+.. version-changed:: 7.6
All Objects were changed from Iterable object to a Generator object.
They are subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -53,9 +53,9 @@
Subclasses can override :meth:`filter_item` for more complex
filtering logic.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
Renamed from _RequestWrapper.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Introduced :attr:`filter_func` and :meth:`filter_item` for
instance-level item filtering.
"""
@@ -69,7 +69,7 @@
Returns the instance-specific filter if set, otherwise the
class-level default (None by default).
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:return: Callable that accepts an item and returns True to
yield, False to skip; or None to disable filtering
@@ -80,7 +80,7 @@
def filter_func(self, func: Callable[[Any], bool] | None):
"""Set a filter function to apply to items before yielding.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param func: Callable that accepts an item and returns True to
yield, False to skip; or None to disable filtering
@@ -93,7 +93,7 @@
By default, applies :attr:`filter_func` if set. Returns True if
no filter is set.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param item: The item to check
:return: True if the item should be yielded, False otherwise
@@ -120,8 +120,8 @@
def set_maximum_items(self, value: int | str | None) -> None:
"""Set the maximum number of items to be retrieved from the wiki.
- .. versionadded:: 7.1
- .. versionchanged:: 7.6
+ .. version-added:: 7.1
+ .. version-changed:: 7.6
become an abstract method
"""
raise NotImplementedError
@@ -136,7 +136,7 @@
automatically. If the limit attribute is set, the iterator will stop
after iterating that many values.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -219,9 +219,9 @@
Applies :meth:`filter_item()<APIGeneratorBase.filter_item>` to
each item before yielding.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
Changed from iterator method to generator property
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Applies `filter_item` for instance-level filtering.
:yield: Items from the MediaWiki API, filtered by `filter_item()`
@@ -275,7 +275,7 @@
list of pages or links. See the API documentation for specific query
options.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -548,12 +548,12 @@
def continue_update(self) -> None:
"""Update query with continue parameters.
- .. versionadded:: 3.0
- .. versionchanged:: 4.0
+ .. version-added:: 3.0
+ .. version-changed:: 4.0
explicit return a bool value to be used in :meth:`generator`
- .. versionchanged:: 6.0
+ .. version-changed:: 6.0
always return *False*
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
return *None* instead of *False*.
"""
for key, value in self.data[self.continue_name].items():
@@ -634,7 +634,7 @@
passes :meth:`filter_item() <APIGeneratorBase.filter_item>` and
respects namespaces and the generator's limit.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Applies `filter_item()` for instance-level filtering.
:param resultdata: List or iterable of raw API items
@@ -679,9 +679,9 @@
Continues response as needed until limit (if any) is reached.
Each item is already filtered by `_extract_results()`.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
Changed from iterator method to generator property
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Items are filtered via :meth:`filter_item()
<APIGeneratorBase.filter_item>` inside :meth:`_extract_results`.
@@ -771,7 +771,7 @@
Required and optional parameters are as for ``Request``, except
that ``action=query`` is assumed and generator is required.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
retrieve the same imageinfo properties as in
:meth:`APISite.loadimageinfo()
<pywikibot.site._apisite.APISite.loadimageinfo>` with default
@@ -813,11 +813,11 @@
This can be overridden in subclasses to return a different type
of object.
- .. versionchanged:: 9.5
+ .. version-changed:: 9.5
No longer raise :exc:`exceptions.UnsupportedPageError` but
return a generic :class:`pywikibot.Page` object. The exception
is raised when getting the content for example.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
Upcast to :class:`page.FilePage` if *pagedata* has
``imageinfo`` contents even if the file extension is invalid.
"""
@@ -852,7 +852,7 @@
dict for each page queried via a titles= or ids= parameter (which
must be supplied when instantiating this class).
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Supports instance-level filtering via :attr:`filter_func
<APIGenerator.filter_func>` / :meth:`filter_item()
<APIGenerator.filter_item`.
@@ -881,10 +881,10 @@
def generator(self):
"""Yield results from the API, including previously retrieved dicts.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
Changed from iterator method to generator property.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Items are filtered via :meth:`filter_item()
<APIGenerator.filter_item` inside :meth:`_extract_results`.
Previously retrieved dicts in `_previous_dicts` are also
@@ -915,7 +915,7 @@
def _fully_retrieved_data_dicts(self, resultdata):
"""Yield items of self._previous_dicts that are not in resultdata.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Applies :meth:`filter_item()<APIGenerator.filter_item` to
previously stored dicts.
@@ -1064,7 +1064,7 @@
def _update_langlinks(page, langlinks) -> None:
"""Update page langlinks.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
only add a language link if it is found in the family file.
:meta public:
diff --git a/pywikibot/data/api/_optionset.py b/pywikibot/data/api/_optionset.py
index e401db8..9e3cd6b 100644
--- a/pywikibot/data/api/_optionset.py
+++ b/pywikibot/data/api/_optionset.py
@@ -37,7 +37,7 @@
If a site is given, the module and param must be given too.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*dict* parameter was renamed to *data*.
:param site: The associated site
diff --git a/pywikibot/data/api/_paraminfo.py b/pywikibot/data/api/_paraminfo.py
index a455b25..96ddc12 100644
--- a/pywikibot/data/api/_paraminfo.py
+++ b/pywikibot/data/api/_paraminfo.py
@@ -39,7 +39,7 @@
preloaded_modules: set[str] | None = None) -> None:
"""Initializer.
- .. deprecated:: 8.4
+ .. version-deprecated:: 8.4
the *modules_only_mode* parameter
:param preloaded_modules: API modules to preload
@@ -283,7 +283,7 @@
For duplicate paths, the value will be False.
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
``normalize_paraminfo`` became a staticmethod.
"""
result_data = {}
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index d77a0c6..51fd559 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -136,10 +136,10 @@
>>> sorted(data['query'])
['namespaces', 'userinfo']
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
inherited from :class:`WaitingMixin`.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*keys* and *items* methods return a view object instead a list
"""
@@ -405,7 +405,7 @@
def iteritems(self):
"""Implement dict interface.
- .. deprecated:: 9.0
+ .. version-deprecated:: 9.0
Use ``items()`` instead.
"""
return iter(self.items())
@@ -681,10 +681,10 @@
paramstring) -> tuple:
"""Get or post a http request with exception handling.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
change the scheme if the previous request didn't have json
content.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
no wait cycles for :exc:`ImportError` and :exc:`NameError`.
:return: a tuple containing requests.Response object from
@@ -745,7 +745,7 @@
def _json_loads(self, response) -> dict | None:
"""Return a dict from requests.Response.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
show a warning to add a ``protocol()`` method to the family
file if suitable.
@@ -841,9 +841,9 @@
def _handle_warnings(self, result: dict[str, Any]) -> bool:
"""Handle warnings; return True to retry request, False to resume.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
Return True to retry the current request and False to resume.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
Handle warnings of formatversion 2.
.. seealso:: :api:`Errors and warnings`
@@ -888,7 +888,7 @@
Return True to retry the request, False to resume and None if
the warning is not handled.
- .. versionadded:: 7.2
+ .. version-added:: 7.2
:meta public:
"""
@@ -1007,7 +1007,7 @@
Also reset last API error with wait cycles.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
:param delay: Minimum time in seconds to wait. Overwrites
``retry_wait`` variable if given. The delay doubles each
@@ -1019,10 +1019,10 @@
def submit(self) -> dict:
"""Submit a query and parse the response.
- .. versionchanged:: 8.0.4
+ .. version-changed:: 8.0.4
in addition to *readapidenied* also try to login when API
response is *notloggedin*.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Raise :exc:`exceptions.APIError` if the same error comes
twice in a row within the loop.
@@ -1201,7 +1201,7 @@
"""Cached request.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
timestamp with timezone is used to determine expiry.
"""
@@ -1232,9 +1232,9 @@
The directory will be created if it does not already exist.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
return a `pathlib.Path` object.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
remove Python main version from directory name
:return: base directory path for cache entries
@@ -1250,10 +1250,10 @@
def _make_dir(dir_name: str | Path) -> Path:
"""Create directory if it does not exist already.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
Only `FileExistsError` is ignored but other OS exceptions can
be still raised
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
use *dir_name* as str or `pathlib.Path` object but always
return a Path object.
@@ -1298,7 +1298,7 @@
def _cachefile_path(self) -> Path:
"""Create the cachefile path.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
return a `pathlib.Path` object.
:meta public:
diff --git a/pywikibot/data/citoid.py b/pywikibot/data/citoid.py
index 96a4326..d31b4e2 100644
--- a/pywikibot/data/citoid.py
+++ b/pywikibot/data/citoid.py
@@ -1,6 +1,6 @@
"""Citoid Query interface.
-.. versionadded:: 10.6
+.. version-added:: 10.6
"""
#
# (C) Pywikibot team, 2025
diff --git a/pywikibot/data/memento.py b/pywikibot/data/memento.py
index 83784cc..06d6dd5 100644
--- a/pywikibot/data/memento.py
+++ b/pywikibot/data/memento.py
@@ -1,7 +1,7 @@
"""Fix ups for memento-client package version 0.6.1.
-.. versionadded:: 7.4
-.. versionchanged:: 10.7
+.. version-added:: 7.4
+.. version-changed:: 10.7
Set default timegate to :attr:`DEFAULT_TIMEGATE_BASE_URI`
.. seealso:: https://github.com/mementoweb/py-memento-client#readme
"""
@@ -45,9 +45,9 @@
It makes it straightforward to access the Web of the past as it is
to access the current Web.
- .. versionchanged:: 7.4
+ .. version-changed:: 7.4
`timeout` is used in several methods.
- .. versionchanged:: 10.7
+ .. version-changed:: 10.7
Set default timegate to :attr`DEFAULT_TIMEGATE_BASE_URI`
Basic usage:
@@ -278,7 +278,7 @@
timeout: int | None = None) -> requests.Response:
"""Makes HEAD requests.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
The default timout was increased from 9 to 30 seconds.
:param uri: the uri for the request.
@@ -332,7 +332,7 @@
timeout: int | None = None):
"""Get most recent memento for url.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
The *timeout* parameter.
:param url: The input http url.
diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py
index 01298a3..b5dfb71 100644
--- a/pywikibot/data/sparql.py
+++ b/pywikibot/data/sparql.py
@@ -29,7 +29,7 @@
This class allows to run SPARQL queries against any SPARQL endpoint.
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
inherited from :class:`data.WaitingMixin` which provides a
:meth:`data.WaitingMixin.wait` method.
"""
@@ -130,10 +130,10 @@
def query(self, query: str, headers: dict[str, str] | None = None):
"""Run SPARQL query and return parsed JSON result.
- .. versionchanged:: 8.5
+ .. version-changed:: 8.5
:exc:`exceptions.NoUsernameError` is raised if the response
looks like the user is not logged in.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
retry on internal server error (500).
:param query: Query text
diff --git a/pywikibot/data/superset.py b/pywikibot/data/superset.py
index d07ade8..51a2dc9 100644
--- a/pywikibot/data/superset.py
+++ b/pywikibot/data/superset.py
@@ -4,7 +4,7 @@
This module only works with a *client login* (including 2FA).
It does **not** work with BotPassword or OAuth accounts.
-.. versionadded:: 9.2
+.. version-added:: 9.2
"""
#
# (C) Pywikibot team, 2024-2025
diff --git a/pywikibot/data/wikistats.py b/pywikibot/data/wikistats.py
index e3570cf..cb4b3c6 100644
--- a/pywikibot/data/wikistats.py
+++ b/pywikibot/data/wikistats.py
@@ -25,7 +25,7 @@
The methods accept a Pywikibot family name as the WikiStats table name,
mapping the names before calling the WikiStats API.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
tables are cached globally instead by instances.
"""
diff --git a/pywikibot/date.py b/pywikibot/date.py
index a275384..736df79 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -335,7 +335,7 @@
def intToRomanNum(i: int) -> str:
"""Convert integer to roman numeral.
- .. versionchanged:: 9.5
+ .. version-changed:: 9.5
negative *i* is no longer accepted but 31 is a valid value.
:raises IndexError: Roman value *i* is nont in range 0..31
@@ -348,7 +348,7 @@
def romanNumToInt(v: str) -> int:
"""Convert roman numeral to integer.
- .. versionchanged:: 9.5
+ .. version-changed:: 9.5
``XXXI`` can be converted.
"""
return _romanNumbers.index(v)
@@ -469,7 +469,7 @@
lambda v: dh(v, 'pattern string', encf, decf)
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*filter* parameter was renamed to *filter_func*
:param encf: Converts from an integer parameter to another integer
diff --git a/pywikibot/diff.py b/pywikibot/diff.py
index 4107f67..4810942 100644
--- a/pywikibot/diff.py
+++ b/pywikibot/diff.py
@@ -641,7 +641,7 @@
>>> get_close_matches_ratio('Pywikibot', p, n=2, cutoff=0, ignorecase=True)
[(0.4444444444444444, 'Wikipedia'), (0.42857142857142855, 'Robot')]
- .. versionadded:: 9.4
+ .. version-added:: 9.4
.. note:: Most code is incorporated from Python software under the
`PSF`_ license.
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index 2dcd683..b853da5 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -17,18 +17,18 @@
"""A notification issued by the Echo extension.
- .. versionchanged:: 3.0.20190204
+ .. version-changed:: 3.0.20190204
The ``id`` attribute was renamed to ``event_id``, and its type
changed from ``str`` to ``int``.
- .. deprecated:: 3.0.20190204
+ .. version-deprecated:: 3.0.20190204
The ``id`` attribute was retained temporarily for backward
compatibility, but is deprecated and scheduled for removal.
- .. versionremoved:: 7.0
+ .. version-removed:: 7.0
The ``id`` attribute was removed.
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
The class is now defined using the ``@dataclass`` decorator to
simplify internal initialization and improve maintainability.
"""
diff --git a/pywikibot/editor.py b/pywikibot/editor.py
index 4b6d578..bec6552 100644
--- a/pywikibot/editor.py
+++ b/pywikibot/editor.py
@@ -39,7 +39,7 @@
"""Text editor.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Editor detection functions were moved from :mod:`config`.
"""
diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py
index ac14c12..a55f1e5 100644
--- a/pywikibot/exceptions.py
+++ b/pywikibot/exceptions.py
@@ -159,15 +159,15 @@
- ArgumentDeprecationWarning: command line argument problems
- FamilyMaintenanceWarning: missing information in family definition
-.. versionchanged:: 6.0
+.. version-changed:: 6.0
exceptions were renamed and are ending with "Error".
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
All Pywikibot Error exceptions must be imported from
``pywikibot.exceptions``. Deprecated exceptions identifiers were
removed.
-.. versionchanged:: 8.1
+.. version-changed:: 8.1
``Server414Error`` class is deprecated; use :class:`Client414Error`
instead.
"""
@@ -286,7 +286,7 @@
This class should be used when the Exception concerns a particular
Page, and when a generic message can be written once for all.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
A pageid is accepted with the first parameter
"""
@@ -381,7 +381,7 @@
"""Expected rename target user not found.
- .. versionadded:: 9.4
+ .. version-added:: 9.4
"""
message = 'Rename target user of {} not found.'
@@ -412,11 +412,11 @@
"""ItemPage has no sitelink to the given site.
- .. versionadded:: 8.1
- .. deprecated:: 8.1
+ .. version-added:: 8.1
+ .. version-deprecated:: 8.1
This exception depends on :exc:`NoPageError` but it will be
removed.
- .. versionremoved:: 11.0
+ .. version-removed:: 11.0
Dependency on :exc:`NoPageError` was removed.
"""
@@ -507,7 +507,7 @@
"""Missing page history.
- .. versionadded:: 6.2
+ .. version-added:: 6.2
"""
message = 'Page {} is invalid.'
@@ -617,7 +617,7 @@
"""Got unexpected server response due to client issue.
- .. versionadded:: 8.1
+ .. version-added:: 8.1
"""
@@ -625,7 +625,7 @@
"""Server returned with HTTP 414 code.
- .. versionadded:: 8.1
+ .. version-added:: 8.1
"""
diff --git a/pywikibot/families/commons_family.py b/pywikibot/families/commons_family.py
index 527ce55..43adfbe 100644
--- a/pywikibot/families/commons_family.py
+++ b/pywikibot/families/commons_family.py
@@ -13,7 +13,7 @@
"""Family class for Wikimedia Commons.
- .. versionchanged:: 6.5
+ .. version-changed:: 6.5
:meth:`family.WikibaseFamily.interface` was changed to
:class:`DataSite<pywikibot.site._datasite.DataSite>` to enable
structured data.
diff --git a/pywikibot/families/foundation_family.py b/pywikibot/families/foundation_family.py
index 3e57da8..2711283 100644
--- a/pywikibot/families/foundation_family.py
+++ b/pywikibot/families/foundation_family.py
@@ -1,9 +1,9 @@
"""Family module for Foundation wiki.
-.. versionadded:: 3.0
+.. version-added:: 3.0
"""
#
-# (C) Pywikibot team, 2019-2022
+# (C) Pywikibot team, 2019-2025
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Foundation wiki.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
name = 'foundation'
diff --git a/pywikibot/families/lingualibre_family.py b/pywikibot/families/lingualibre_family.py
index 6b81c93..ea1bea5 100644
--- a/pywikibot/families/lingualibre_family.py
+++ b/pywikibot/families/lingualibre_family.py
@@ -1,9 +1,9 @@
"""Family module for Lingua Libre.
-.. versionadded:: 6.5
+.. version-added:: 6.5
"""
#
-# (C) Pywikibot team, 2021-2024
+# (C) Pywikibot team, 2021-2025
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Lingua Libre.
- .. versionadded:: 6.5
+ .. version-added:: 6.5
"""
name = 'lingualibre'
diff --git a/pywikibot/families/wikifunctions_family.py b/pywikibot/families/wikifunctions_family.py
index b240a1f..df510ab 100644
--- a/pywikibot/families/wikifunctions_family.py
+++ b/pywikibot/families/wikifunctions_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikifunction.
-.. versionadded:: 8.4
+.. version-added:: 8.4
"""
#
-# (C) Pywikibot team, 2023
+# (C) Pywikibot team, 2023-2025
#
# Distributed under the terms of the MIT license.
#
diff --git a/pywikibot/families/wikihow_family.py b/pywikibot/families/wikihow_family.py
index 6e4fae8..030b7a2 100644
--- a/pywikibot/families/wikihow_family.py
+++ b/pywikibot/families/wikihow_family.py
@@ -1,9 +1,9 @@
"""Family module for wikiHow wiki.
-.. versionadded:: 3.0
+.. version-added:: 3.0
"""
#
-# (C) Pywikibot team, 2020-2024
+# (C) Pywikibot team, 2020-2025
#
# Distributed under the terms of the MIT license.
#
@@ -17,7 +17,7 @@
"""Family class for wikiHow Wiki.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
name = 'wikihow'
diff --git a/pywikibot/families/wikimania_family.py b/pywikibot/families/wikimania_family.py
index a43a36a..159b146 100644
--- a/pywikibot/families/wikimania_family.py
+++ b/pywikibot/families/wikimania_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikimania wikis.
-.. versionadded:: 3.0
+.. version-added:: 3.0
"""
#
-# (C) Pywikibot team, 2017-2024
+# (C) Pywikibot team, 2017-2025
#
# Distributed under the terms of the MIT license.
#
@@ -18,7 +18,7 @@
"""Family class for Wikimania wikis.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
name = 'wikimania'
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index ce0cbb6f..185e52b 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -229,7 +229,7 @@
def __post_init__(cls) -> None:
"""Add 'yue' code alias due to :phab:`T341960`.
- .. versionadded:: 8.3
+ .. version-added:: 8.3
"""
aliases = cls.code_aliases.copy()
aliases['yue'] = 'zh-yue'
diff --git a/pywikibot/families/wikispore_family.py b/pywikibot/families/wikispore_family.py
index f07a42b..e229d7e 100644
--- a/pywikibot/families/wikispore_family.py
+++ b/pywikibot/families/wikispore_family.py
@@ -1,9 +1,9 @@
"""Family module for Wikispore.
-.. versionadded:: 4.1
+.. version-added:: 4.1
"""
#
-# (C) Pywikibot team, 2020-2023
+# (C) Pywikibot team, 2020-2025
#
# Distributed under the terms of the MIT license.
#
@@ -16,7 +16,7 @@
"""Family class for Wikispore.
- .. versionadded:: 4.1
+ .. version-added:: 4.1
"""
name = 'wikispore'
diff --git a/pywikibot/families/wiktionary_family.py b/pywikibot/families/wiktionary_family.py
index 1f238a0..f0373bb 100644
--- a/pywikibot/families/wiktionary_family.py
+++ b/pywikibot/families/wiktionary_family.py
@@ -14,7 +14,7 @@
"""Family class for Wiktionary.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
``alphabetic_sv`` attribute was removed; ``interwiki_putfirst``
attribute was removed and default setting from parent class is
used.
@@ -96,7 +96,7 @@
def __post_init__(cls) -> None:
"""Add 'zh-yue' code alias due to :phab:`T341960`.
- .. versionadded:: 8.3
+ .. version-added:: 8.3
"""
aliases = cls.code_aliases.copy()
aliases['zh-yue'] = 'yue'
diff --git a/pywikibot/families/wowwiki_family.py b/pywikibot/families/wowwiki_family.py
index bdc5918..ca61b4b 100644
--- a/pywikibot/families/wowwiki_family.py
+++ b/pywikibot/families/wowwiki_family.py
@@ -58,7 +58,7 @@
def categories_last(cls):
"""Property listing site keys for categories at last position.
- .. deprecated:: 10.3
+ .. version-deprecated:: 10.3
use :meth:`site.has_extension('CategorySelect')
<pywikibot.site._apisite.APISite.has_extension>` instead
"""
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 828e28a..fb26879 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -47,17 +47,17 @@
Families are immutable and initializer is unsupported. Any class
modification should go to :meth:`__post_init__` class method.
- .. versionchanged:: 3.0
+ .. version-changed:: 3.0
the family class is immutable. Having an ``__init__`` initializer
method a ``NotImplementedWarning`` will be given.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
``alphabetic``, ``alphabetic_revised`` and ``fyinterwiki``
attributes where removed.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
:attr:`obsolete` setter was removed.
- .. versionchanged:: 8.3
+ .. version-changed:: 8.3
Having an initializer method a ``FutureWarning`` will be given.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
raises RuntimeError if an initializer method was found;
:meth:`__post_init__` classmethod should be used instead.
"""
@@ -316,7 +316,7 @@
.. warning:: This attribute is used within ``re.sub()`` method. Use
escape sequence if necessary
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
_families: dict[str, Family] = {}
@@ -326,7 +326,7 @@
def categories_last(cls) -> list[str]:
"""Categories come after interwiki links for the given site codes.
- .. deprecated:: 10.3
+ .. version-deprecated:: 10.3
use :meth:`site.has_extension('CategorySelect')
<pywikibot.site._apisite.APISite.has_extension>` instead
"""
@@ -430,14 +430,14 @@
def get_edit_restricted_templates(self, code):
"""Return tuple of edit restricted templates.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
return self.edit_restricted_templates.get(code, ())
def get_archived_page_templates(self, code):
"""Return tuple of archived page templates.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
return self.archived_page_templates.get(code, ())
@@ -461,7 +461,7 @@
May be overridden to return 'http'. Other protocols are not
supported.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
``https`` is returned instead of ``http``.
:param code: language code
@@ -472,7 +472,7 @@
def verify_SSL_certificate(self, code: str) -> bool:
"""Return whether a HTTPS certificate should be verified.
- .. versionadded:: 5.3
+ .. version-added:: 5.3
renamed from ignore_certificate_error
:param code: language code
@@ -550,14 +550,14 @@
def eventstreams_host(self, code) -> NoReturn:
"""Hostname for EventStreams.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
raise NotImplementedError('This family does not support EventStreams')
def eventstreams_path(self, code) -> NoReturn:
"""Return path for EventStreams.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
raise NotImplementedError('This family does not support EventStreams')
@@ -592,10 +592,10 @@
applies and then iterates over :attr:`Family.codes` to actually
determine which code applies.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*url* parameter does not have to contain a api/query/script
path
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
accept a trailing slash in *url* after domain.
:param url: the URL which may contain a ``$1``. If it's missing
@@ -698,7 +698,7 @@
def isPublic(self, code) -> bool:
"""Check the wiki require logging in before viewing it.
- .. deprecated:: 10.6
+ .. version-deprecated:: 10.6
"""
return True
@@ -753,9 +753,9 @@
xx: now should get code yy:, add {'xx':'yy'} to
:attr:`code_aliases`.
- .. deprecated:: 10.6
+ .. version-deprecated:: 10.6
Use :attr:`code_aliases` directly instead.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
changed from dict to invariant mapping.
"""
return types.MappingProxyType(cls.code_aliases)
@@ -767,7 +767,7 @@
Codes that should be removed, usually because the site has been
taken down.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
changed from list to invariant frozenset.
"""
return frozenset(cls.removed_wikis + cls.closed_wikis)
@@ -834,7 +834,7 @@
"""Common features of Fandom families.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
renamed from WikiaFamily
"""
@@ -857,7 +857,7 @@
"""Class for all wikimedia families.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
:attr:`knows_codes` attribute was added.
"""
@@ -1023,7 +1023,7 @@
They should be roughly sorted by size.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Sorting order is retrieved via :mod:`wikistats` for each call.
:raises NotImplementedError: Family is not member of
@@ -1069,7 +1069,7 @@
"""A base class for a Wikibase Family.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
"""
def interface(self, code) -> str:
@@ -1106,7 +1106,7 @@
.. warning:: Possibly you have to adjust the repository site in
:meth:`WikibaseFamily.entity_sources` to get the valid entity.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
"""
@property
diff --git a/pywikibot/fixes.py b/pywikibot/fixes.py
index 22f0805..5d4ba04 100644
--- a/pywikibot/fixes.py
+++ b/pywikibot/fixes.py
@@ -1,6 +1,6 @@
"""File containing all standard fixes.
-.. versionremoved:: 11.0
+.. version-removed:: 11.0
The ``yu-tld`` predefined fix was removed.
"""
#
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index dbbabe9..9efd81f 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -416,7 +416,7 @@
For internal use, don't use it directly.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
filename = f'{dirname}/{lang}.json'
try:
@@ -565,11 +565,11 @@
For PLURAL support have a look at the :func:`twtranslate` function.
- .. versionchanged:: 2.0
+ .. version-changed:: 2.0
*parameter* other than a mapping (or None) is deprecated.
- .. versionchanged:: 6.2
+ .. version-changed:: 6.2
ValueError is raised if *parameter* is not a mapping.
- .. versionchanged:: 10.2
+ .. version-changed:: 10.2
TypeError instead of ValueError is raised if *parameter* is not a
mapping.
@@ -662,7 +662,7 @@
.. note:: If *source* is a str and ``config.bot_prefix`` is set to
None, it cannot be determined whether the current user is a bot
account. In this cas the prefix will be returned.
- .. versionadded:: 8.1
+ .. version-added:: 8.1
:param source: When it's a site it's using the lang attribute and otherwise
it is using the value directly.
@@ -746,10 +746,10 @@
... ) % {'descr': 'seulement'})
'Robot: Changer seulement quelques pages.'
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
the *bot_prefix* parameter was added.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
*fallback_prompt* is now returned whenever no translation is found,
including unknown keys in existing packages.
@@ -907,7 +907,7 @@
>>> path.parent.as_posix()
'scripts/i18n'
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:param stem: yield the Path.stem if True and the Path object otherwise
"""
@@ -945,7 +945,7 @@
langs.add(fname.stem)
return sorted(langs)
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
return sorted(
{fname.stem for dirpath in bundles() for fname in dirpath.iterdir()
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index e82fb95..e357ea7 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -1,6 +1,6 @@
"""Objects representing MediaWiki log entries."""
#
-# (C) Pywikibot team, 2007-2024
+# (C) Pywikibot team, 2007-2025
#
# Distributed under the terms of the MIT license.
#
@@ -97,7 +97,7 @@
def params(self) -> dict[str, Any]:
"""Additional data for some log entry types.
- .. versionadded:: 9.4
+ .. version-added:: 9.4
private *_param* attribute became a public property
"""
return self.get('params', {})
@@ -211,7 +211,7 @@
def oldgroups(self) -> list[str]:
"""Return old rights groups.
- .. versionchanged:: 7.5
+ .. version-changed:: 7.5
No longer raise KeyError if `oldgroups` does not exists or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
@@ -222,7 +222,7 @@
def newgroups(self) -> list[str]:
"""Return new rights groups.
- .. versionchanged:: 7.5
+ .. version-changed:: 7.5
No longer raise KeyError if `oldgroups` does not exists or
LogEntry has no additional data e.g. due to hidden data and
insufficient rights.
diff --git a/pywikibot/logging.py b/pywikibot/logging.py
index cd60dcb..ceb2364 100644
--- a/pywikibot/logging.py
+++ b/pywikibot/logging.py
@@ -105,10 +105,10 @@
``exc_info=True``, which causes the log message to include an
exception traceback.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
Positional arguments for *decoder* and *newline* are deprecated;
keyword arguments should be used.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
@@ -166,11 +166,11 @@
>>> info('Pywikibot %(version)d', {'version': 10}) # doctest: +SKIP
Pywikibot 10
- .. versionadded:: 7.2
+ .. version-added:: 7.2
was renamed from :func:`output`. Positional arguments for
*decoder* and *newline* are deprecated; keyword arguments should
be used. Keyword parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
@@ -184,7 +184,7 @@
"""Synonym for :func:`info` for backward compatibility. The arguments are
interpreted as for :func:`logoutput`.
-.. versionchanged:: 7.2
+.. version-changed:: 7.2
was renamed to :func:`info`; `text` was renamed to `msg`; `msg`
paramerer may be omitted; only keyword arguments are allowed except
for `msg`. Keyword parameter *layer* was added.
@@ -203,11 +203,11 @@
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`text` was renamed to `msg`; `msg` parameter may be omitted;
only keyword arguments are allowed except for `msg`. Keyword
parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -223,10 +223,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -241,10 +241,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -258,10 +258,10 @@
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -276,10 +276,10 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`text` was renamed to `msg`; only keyword arguments are allowed
except for `msg`. Keyword parameter *layer* was added.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -294,10 +294,10 @@
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`layer` parameter is optional; `text` was renamed to `msg`;
only keyword arguments are allowed except for `msg`.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
@@ -330,13 +330,13 @@
``msg`` will be sent to stderr via :mod:`pywikibot.userinterfaces`.
The arguments are interpreted as for :func:`logoutput`.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
only keyword arguments are allowed except for `msg`;
`exc_info` keyword is to be used instead of `tb`. Keyword
parameter *layer* was added.
- .. versionchanged:: 7.3
+ .. version-changed:: 7.3
`exc_info` is True by default
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*args* parameter can now given as formatting arguments directly
to the logger.
.. seealso::
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 4565fec..e26555f 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -122,7 +122,7 @@
def __repr__(self) -> str:
"""Return representation string for LoginManager.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
"""
return f'{type(self).__name__}(user={self.username!r})'
@@ -216,10 +216,10 @@
('en', 'wikipedia', 'my_en_wikipedia_user', 'my_en_wikipedia_pass')
('my_username', BotPassword('my_suffix', 'my_password'))
- .. versionchanged:: 10.2
+ .. version-changed:: 10.2
Raises ValueError instead of AttributeError if password_file
is not set.
- .. versionchanged:: 10.7.1
+ .. version-changed:: 10.7.1
Due to vulnerability issue the password lines are no longer
evaluated as Python source but parsed as literals.
Raises ValueError if an exception occurs while evaluating a
@@ -362,10 +362,10 @@
"""Supply login_to_site method to use API interface.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
2FA login was enabled. LoginManager was moved from :mod:`data.api`
to :mod:`login` module and renamed to *ClientLoginManager*.
- .. versionchanged:: 10.2
+ .. version-changed:: 10.2
Secondary authentication via email was enabled.
.. seealso::
- https://www.mediawiki.org/wiki/Extension:OATHAuth
@@ -421,9 +421,9 @@
Note, this doesn't do anything with cookies. The http module
takes care of all the cookie stuff. Throws exception on failure.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
2FA login was implemented.
- .. versionchanged:: 10.2
+ .. version-changed:: 10.2
Secondary authentication via email was implemented.
:raises RuntimeError: Unexpected API login response key or
@@ -658,7 +658,7 @@
Implemented to discard user interaction token fetching,
usually for tests.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
"""
return self._access_token
@@ -671,7 +671,7 @@
def identity(self) -> dict[str, Any] | None:
"""Get identifying information about a user via an authorized token.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
*leeway* parameter for ``mwoauth.identify`` function was
increased to 30.0 seconds.
"""
diff --git a/pywikibot/page/_basepage.py b/pywikibot/page/_basepage.py
index db6cacd..14e4bc1 100644
--- a/pywikibot/page/_basepage.py
+++ b/pywikibot/page/_basepage.py
@@ -363,7 +363,7 @@
...
pywikibot.exceptions.IsRedirectPageError: ... is a redirect page.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
:exc:`exceptions.SectionError` is raised if the
:meth:`section` does not exists
.. seealso:: :attr:`text` property
@@ -403,7 +403,7 @@
Not existing pages are considered loaded.
- .. versionadded:: 7.6
+ .. version-added:: 7.6
"""
return not self.exists() or self._latest_cached_revision() is not None
@@ -443,7 +443,7 @@
) -> pywikibot.page.Revision:
"""Return an old revision of this page.
- .. versionadded:: 9.6
+ .. version-added:: 9.6
.. seealso:: :meth:`getOldVersion`
@@ -459,7 +459,7 @@
def getOldVersion(self, oldid, force: bool = False) -> str:
"""Return text of an old revision of this page.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
The unused parameter *get_redirect* was removed.
.. seealso:: :meth:`get_revision`
@@ -624,7 +624,7 @@
def get_parsed_page(self, force: bool = False) -> str:
"""Retrieve parsed text (via action=parse) and cache it.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
`force` parameter was added;
`_get_parsed_page` becomes a public method
@@ -645,7 +645,7 @@
intro: bool = True) -> str:
"""Retrieve an extract of this page.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
:param variant: The variant of extract, either 'plain' for plain
text, 'html' for limited HTML (both excludes templates and
@@ -746,7 +746,7 @@
def userName(self) -> str:
"""Return name or IP address of last user to edit page.
- .. deprecated:: 9.3
+ .. version-deprecated:: 9.3
Use :attr:`latest_revision.user<latest_revision>`
instead.
"""
@@ -756,7 +756,7 @@
def isIpEdit(self) -> bool:
"""Return True if last editor was unregistered.
- .. deprecated:: 9.3
+ .. version-deprecated:: 9.3
Use :attr:`latest_revision.anon<latest_revision>`
instead.
"""
@@ -817,7 +817,7 @@
A static redirect must be a valid redirect, and contain the magic
word __STATICREDIRECT__.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
__STATICREDIRECT__ can be transcluded
:param force: Bypass local caching
@@ -1072,7 +1072,7 @@
:param total: maximum number of redirects to retrieve in total
:param content: load the current content of each redirect
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
return self.site.page_redirects(
self,
@@ -1278,15 +1278,15 @@
**kwargs) -> None:
"""Save the current contents of page's text to the wiki.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
boolean *watch* parameter is deprecated
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
*botflag* parameter was renamed to *bot*.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
edits cannot be marked as bot edits if the bot account has no
``bot`` right. Therefore a ``None`` argument for *bot*
parameter was dropped.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
boolean *watch* parameter is desupported
.. hint:: Setting up :manpage:`OAuth` or :manpage:`BotPassword
@@ -1426,11 +1426,11 @@
For new code, using :meth:`save` is preferred; also ee that
method docs for all parameters not listed here.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
The `show_diff` parameter
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
*botflag* parameter was renamed to *bot*.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
edits cannot be marked as bot edits if the bot account has no
``bot`` right. Therefore a ``None`` argument for *bot*
parameter was dropped.
@@ -1457,7 +1457,7 @@
) -> bool:
"""Add or remove this page from the bot account's watchlist.
- .. versionchanged:: 10.4.0
+ .. version-changed:: 10.4.0
Added the *expiry* parameter to specify watch expiry time.
Positional parameters are deprecated; all parameters must be
passed as keyword arguments.
@@ -1524,7 +1524,7 @@
.. note:: This discards content saved to self.text.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
*botflag* parameter was renamed to *bot*.
"""
if not self.exists():
@@ -1550,9 +1550,9 @@
For the parameters refer
:py:mod:`APISite.pagelinks<pywikibot.site.APISite.pagelinks>`
- .. versionadded:: 7.0
+ .. version-added:: 7.0
the `follow_redirects` keyword argument.
- .. versionremoved:: 10.0
+ .. version-removed:: 10.0
the positional arguments.
.. seealso::
@@ -1663,12 +1663,12 @@
method caches the result. If *namespaces* is used, all pages are
retrieved and cached but the result is filtered.
- .. versionchanged:: 2.0
+ .. version-changed:: 2.0
a list of :class:`pywikibot.Page` is returned instead of a
list of template titles. The given pages may have namespaces
different from TEMPLATE namespace. *get_redirect* parameter
was removed.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
*namespaces* parameter was added; all parameters must be given
as keyword arguments.
@@ -1711,8 +1711,8 @@
but they can be yielded from the cache of a previous
:meth:`templates` call.
- .. versionadded:: 2.0
- .. versionchanged:: 9.2
+ .. version-added:: 2.0
+ .. version-changed:: 9.2
*namespaces* parameter was added; all parameters except
*total* must be given as keyword arguments.
@@ -1756,10 +1756,10 @@
) -> Iterable[pywikibot.Page]:
"""Iterate categories that the article is in.
- .. versionchanged:: 2.0
+ .. version-changed:: 2.0
*with_sort_key* parameter is not supported and a
NotImplementedError is raised if set.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
*with_sort_key* parameter is supported.
.. seealso:: :meth:`Site.pagecategories()
<pywikibot.site._generators.GeneratorsMixin.pagecategories>`
@@ -1832,7 +1832,7 @@
ignore_section: bool = True) -> pywikibot.Page:
"""Return a Page object for the target this Page redirects to.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
*ignore_section* parameter
.. seealso::
@@ -1977,7 +1977,7 @@
movesubpages: bool = True) -> pywikibot.page.Page:
"""Move this page to a new title.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
The *movesubpages* parameter was added
:param newtitle: The new page title.
@@ -1998,7 +1998,7 @@
def rollback(self, **kwargs: Any) -> dict[str, int | str]:
"""Roll back this page to the version before the last edit by a user.
- .. versionadded:: 10.5
+ .. version-added:: 10.5
.. seealso::
:meth:`Site.rollbackpage()
@@ -2050,7 +2050,7 @@
) -> int:
"""Delete the page from the wiki. Requires administrator status.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
keyword only parameter *deletetalk* was added.
:param reason: The edit summary for the deletion, or rationale
@@ -2120,7 +2120,7 @@
def has_deleted_revisions(self) -> bool:
"""Return True if the page has deleted revisions.
- .. versionadded:: 4.2
+ .. version-added:: 4.2
"""
if not hasattr(self, '_has_deleted_revisions'):
gen = self.site.deletedrevs(self, total=1, prop=['ids'])
@@ -2307,7 +2307,7 @@
show_diff: bool = False) -> bool:
"""Remove page from oldCat and add it to newCat.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
The `show_diff` parameter
:param old_cat: category to be removed
diff --git a/pywikibot/page/_category.py b/pywikibot/page/_category.py
index 5115d45e..37fe8d9 100644
--- a/pywikibot/page/_category.py
+++ b/pywikibot/page/_category.py
@@ -105,7 +105,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
all parameters are keyword arguments only. Additional
parameters are supported. The order of subcategories are
yielded was changed. The old order was
@@ -162,7 +162,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
all parameters are keyword arguments only.
:param recurse: if not False or 0, also iterate articles in
@@ -227,7 +227,7 @@
`sys.getrecursionlimit()`, an ``RecursionError`` may be
raised. Be careful if passing this generator to a collection
in such case.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
all parameters are keyword arguments only. Additional
parameters are supported.
diff --git a/pywikibot/page/_collections.py b/pywikibot/page/_collections.py
index dea73af..dad0c62 100644
--- a/pywikibot/page/_collections.py
+++ b/pywikibot/page/_collections.py
@@ -149,7 +149,7 @@
def normalizeData(cls, data: dict) -> dict:
"""Helper function to expand data into the Wikibase API structure.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
raises TypeError if *data* value is not a list.
:param data: Data to normalize
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 1489c6e..b3dec04 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -42,11 +42,11 @@
ignore_extension: bool = False) -> None:
"""Initializer.
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
Check for valid extensions.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
Added the optional *ignore_extension* parameter.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
Show a warning if *ignore_extension* was set and the
extension is invalid.
.. seealso::
@@ -133,7 +133,7 @@
This function will load also metadata.
It is also used as a helper in FileInfo to load metadata lazily.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
:param ts: timestamp of the Image rev. to retrieve
@@ -213,7 +213,7 @@
def file_is_shared(self) -> bool:
"""Check if the file is stored on any known shared repository.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
return False if file does not exist on shared image repository
instead raising NoPageError.
"""
@@ -266,11 +266,11 @@
'Pywikibot'
.. seealso:: :meth:`globalusage`
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
all parameters from :meth:`APISite.imageusage()
<pywikibot.site._generators.GeneratorsMixin.imageusage>`
are available.
- .. versionchanged:: 7.4
+ .. version-changed:: 7.4
renamed from :meth:`usingPages`.
"""
return self.site.imageusage(self, **kwargs)
@@ -279,7 +279,7 @@
def file_is_used(self) -> bool:
"""Check whether the file is used at this site.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
"""
return bool(list(self.using_pages(total=1)))
@@ -361,9 +361,9 @@
The suffix has changed and Pywikibot_MW_gear_icon.png was
downloaded.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
*url_width*, *url_height* and *url_param* parameters.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*filename* argument may be also a path-like object or an
iterable of path segments.
.. note:: filename suffix is adjusted if target url's suffix is
@@ -445,7 +445,7 @@
the method returns the associated mediainfo entity. Otherwise,
it falls back to the behavior of :meth:`BasePage.data_item`.
- .. versionadded:: 6.5
+ .. version-added:: 6.5
:rtype: pywikibot.page.WikibaseEntity
"""
@@ -474,10 +474,10 @@
.. note:: timestamp will be casted to :func:`pywikibot.Timestamp`.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
raises KeyError instead of AttributeError if FileInfo is used as
Mapping.
- .. versionchanged:: 8.6
+ .. version-changed:: 8.6
Metadata are loaded lazily.
Added *filepage* parameter.
"""
@@ -491,7 +491,7 @@
def update(self, file_revision) -> None:
"""Update FileInfo with new values.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
"""
for k, v in file_revision.items():
if k == 'timestamp':
@@ -518,7 +518,7 @@
def metadata(self):
"""Return metadata.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
"""
if self._metadata is None:
self.filepage.get_file_info(self.timestamp)
@@ -528,6 +528,6 @@
def metadata(self, value) -> None:
"""Set metadata.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
"""
self._metadata = value
diff --git a/pywikibot/page/_links.py b/pywikibot/page/_links.py
index 639cd30..57c130b 100644
--- a/pywikibot/page/_links.py
+++ b/pywikibot/page/_links.py
@@ -6,7 +6,7 @@
its contents.
"""
#
-# (C) Pywikibot team, 2008-2024
+# (C) Pywikibot team, 2008-2025
#
# Distributed under the terms of the MIT license.
#
@@ -649,7 +649,7 @@
- badges: Any badges associated with the sitelink
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
# Components used for __repr__
diff --git a/pywikibot/page/_page.py b/pywikibot/page/_page.py
index 8a5a5a7..b02390f 100644
--- a/pywikibot/page/_page.py
+++ b/pywikibot/page/_page.py
@@ -133,7 +133,7 @@
) -> None:
"""Change the page's text to point to the redirect page.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
*botflag* keyword parameter was renamed to *bot*.
:param target_page: target of the redirect, this argument is
@@ -188,7 +188,7 @@
Return the first 'preferred' ranked Claim specified by Wikibase
property or the first 'normal' one otherwise.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
.. seealso:: :meth:`pywikibot.ItemPage.get_best_claim`
diff --git a/pywikibot/page/_toolforge.py b/pywikibot/page/_toolforge.py
index e6c5820..389adc3 100644
--- a/pywikibot/page/_toolforge.py
+++ b/pywikibot/page/_toolforge.py
@@ -1,6 +1,6 @@
"""Object representing interface to toolforge tools.
-.. versionadded:: 7.7
+.. version-added:: 7.7
"""
#
# (C) Pywikibot team, 2022-2025
@@ -22,7 +22,7 @@
"""Page mixin for main authorship.
- .. versionadded:: 7.7
+ .. version-added:: 7.7
"""
#: Supported wikipedia site codes
@@ -59,7 +59,7 @@
>>> auth.most_common(1)
[('DrTrigon', 37)]
- .. deprecated:: 9.3
+ .. version-deprecated:: 9.3
use :meth:`authorship` instead.
.. seealso:: :meth:`authorship` for further informations
@@ -99,10 +99,10 @@
.. important:: Only implemented for pages in Main, Project,
Category and Template namespaces and only wikipedias of
:attr:`WIKIBLAME_CODES` are supported.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
XTools is used to retrieve authors. This method replaces
:meth:`main_authors`.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
WikiHistory is used to retrieve authors due to :phab:`T392694`.
Here are the differences between these two implementations:
@@ -111,7 +111,7 @@
.. tab:: WikiHistory
- .. versionadded:: 10.1
+ .. version-added:: 10.1
- Implemented from version 7.7 until 9.2 (with
:meth:`main_authors` method) and from 10.1.
@@ -131,7 +131,7 @@
.. tab:: XTools
- .. versionremoved:: 10.1
+ .. version-removed:: 10.1
- Implemented from version 9.3 until 10.0.
- Only Main namespace is supported.
diff --git a/pywikibot/page/_user.py b/pywikibot/page/_user.py
index 9d4ea52..7dfce2c 100644
--- a/pywikibot/page/_user.py
+++ b/pywikibot/page/_user.py
@@ -95,7 +95,7 @@
def is_CIDR(self) -> bool: # noqa: N802
"""Determine if the input refers to a range of IP addresses.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
.. seealso::
- :meth:`isRegistered`
- :meth:`isAnonymous`
@@ -106,7 +106,7 @@
def getprops(self, force: bool = False) -> dict[str, Any]:
"""Return a properties about the user.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
detect range blocks
:param force: if True, forces reloading the data from API
@@ -150,9 +150,9 @@
def is_blocked(self, force: bool = False) -> bool:
"""Determine whether the user is currently blocked.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
renamed from :meth:`isBlocked` method
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
can also detect range blocks.
:param force: if True, forces reloading the data from API
@@ -162,7 +162,7 @@
def is_locked(self, force: bool = False) -> bool:
"""Determine whether the user is currently locked globally.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:param force: if True, forces reloading the data from API
"""
@@ -409,7 +409,7 @@
) -> Generator[tuple[Page, Revision]]:
"""Yield tuples describing this user's deleted edits.
- .. versionadded:: 5.5
+ .. version-added:: 5.5
:param total: Limit results to this number of pages
:keyword start: Iterate contributions starting at this Timestamp
@@ -477,7 +477,7 @@
* :meth:`BasePage.moved_target`
* :meth:`BasePage.getRedirectTarget`
- .. versionadded:: 9.4
+ .. version-added:: 9.4
:raises NoRenameTargetError: user was not renamed
"""
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index 5da0ea6..ce8b3b2 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -299,7 +299,7 @@
.. seealso:: :meth:`WikibasePage.editEntity`
- .. versionchanged:: 8.0.1
+ .. version-changed:: 8.0.1
Copy snak IDs/hashes (:phab:`T327607`)
:param data: Data to be saved
@@ -372,7 +372,7 @@
"""Interface for MediaInfo entities on Commons.
- .. versionadded:: 6.5
+ .. version-added:: 6.5
"""
entity_type = 'mediainfo'
@@ -407,7 +407,7 @@
def _defined_by(self, singular: bool = False) -> dict:
"""Function to provide the API parameters to identify the entity.
- .. versionadded:: 8.5
+ .. version-added:: 8.5
:param singular: Whether the parameter names should use the singular
form
@@ -452,7 +452,7 @@
of this entity and their modifying may indirectly cause
unwanted change to the live content
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Added *pageid*, *ns*, *title*, *lastrevid*, *modified*, *id*
values to ``_content`` attribute when it is loaded.
@@ -521,7 +521,7 @@
def title(self) -> str:
"""Return ID as title of the MediaInfo.
- .. versionadded:: 9.4
+ .. version-added:: 9.4
.. seealso:: :meth:`getID`
:raises NoWikibaseEntityError: if this entity is associated with
@@ -544,7 +544,7 @@
>>> item = page.data_item()
>>> item.editLabels({'en': 'Test file.'}) # doctest: +SKIP
- .. versionadded:: 8.5
+ .. version-added:: 8.5
"""
data = {'labels': labels}
self.editEntity(data, **kwargs)
@@ -552,7 +552,7 @@
def addClaim(self, claim, bot: bool = True, **kwargs) -> None:
"""Add a claim to the MediaInfo.
- .. versionadded:: 8.5
+ .. version-added:: 8.5
:param claim: The claim to add
:type claim: pywikibot.page.Claim
@@ -569,7 +569,7 @@
def removeClaims(self, claims, **kwargs) -> None:
"""Remove the claims from the MediaInfo.
- .. versionadded:: 8.5
+ .. version-added:: 8.5
:param claims: list of claims to be removed
:type claims: list or pywikibot.Claim
@@ -1168,7 +1168,7 @@
def getRedirectTarget(self, *, ignore_section: bool = True):
"""Return the redirect target for this page.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
*ignore_section* parameter
.. seealso:: :meth:`page.BasePage.getRedirectTarget`
@@ -1217,7 +1217,7 @@
If the item doesn't have a link to that site, raise
NoSiteLinkError.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
raises NoSiteLinkError instead of NoPageError.
:param site: Site to find the linked page of.
@@ -1309,7 +1309,7 @@
You need to define an extra argument to make this work, like
:code:`save=True`.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
*botflag* keyword parameter was renamed to *bot*.
:param target_page: target of the redirect, this argument is
@@ -1349,7 +1349,7 @@
Return the first 'preferred' ranked Claim specified by Wikibase
property or the first 'normal' one otherwise.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
.. seealso:: :meth:`pywikibot.Page.get_best_claim`
@@ -1385,7 +1385,7 @@
) -> pywikibot.WbRepresentation | None:
"""Return the best value for this page at a given timestamp.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
:param prop: property id, "P###"
:param timestamp: the timestamp to check the value at
@@ -1514,7 +1514,7 @@
def exists(self) -> bool:
"""Determine if the property exists in the data repository.
- .. versionadded:: 9.4
+ .. version-added:: 9.4
"""
try:
self._type = self.repo.get_property_type(self)
@@ -1527,7 +1527,7 @@
def type(self) -> str:
"""Return the type of this property.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
raises :exc:`NoWikibaseEntityError` if property does not
exist.
@@ -1824,7 +1824,7 @@
def fromJSON(cls, site, data: dict[str, Any]) -> Claim:
"""Create a claim object from JSON returned in the API call.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
print a warning if the Claim.type is not given and missing in
the wikibase.
@@ -2242,7 +2242,7 @@
def has_better_rank(self, other: Claim | None) -> bool:
"""Check if this claim has a better rank than the other claim.
- .. versionadded:: 10.6
+ .. version-added:: 10.6
:param other: The other claim to compare with.
:return: True if this claim has a better rank, False otherwise.
diff --git a/pywikibot/pagegenerators/__init__.py b/pywikibot/pagegenerators/__init__.py
index a56492d..d5c1924 100644
--- a/pywikibot/pagegenerators/__init__.py
+++ b/pywikibot/pagegenerators/__init__.py
@@ -213,7 +213,7 @@
logevent,username,start,end
- .. deprecated:: 9.2
+ .. version-deprecated:: 9.2
backward compatible *total* argument like
``logevent,username,total``; use ``-limit`` filter
option instead (see below).
diff --git a/pywikibot/pagegenerators/_factory.py b/pywikibot/pagegenerators/_factory.py
index 83ff73c..e66df92 100644
--- a/pywikibot/pagegenerators/_factory.py
+++ b/pywikibot/pagegenerators/_factory.py
@@ -132,7 +132,7 @@
Otherwise the value is undefined and gives None.
- .. versionadded:: 7.3
+ .. version-added:: 7.3
"""
def _validate_options(self,
@@ -203,9 +203,9 @@
Only call this after all arguments have been parsed.
- .. versionchanged:: 7.3
+ .. version-changed:: 7.3
set the instance variable :attr:`is_preloading` to True or False.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
if ``limit`` option is set and multiple generators are given,
pages are yieded in a :func:`roundrobin
<tools.itertools.roundrobin_generators>` way.
@@ -373,7 +373,7 @@
) -> Iterable[pywikibot.page.BasePage] | None:
"""Parse the -logevent argument information.
- .. deprecated:: 9.2
+ .. version-deprecated:: 9.2
the *start* parameter as total amount of pages.
:param logtype: A valid logtype
@@ -928,7 +928,7 @@
def _handle_redirect(self, value: str) -> Literal[True]:
"""Handle `-redirect` argument.
- .. versionadded:: 8.5
+ .. version-added:: 8.5
"""
if not value:
# True by default
@@ -939,7 +939,7 @@
def _handle_pagepile(self, value: str) -> HANDLER_GEN_TYPE:
"""Handle `-pagepile` argument.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
if not value.isnumeric():
raise ValueError(
@@ -949,8 +949,8 @@
def handle_args(self, args: Iterable[str]) -> list[str]:
"""Handle command line arguments and return the rest as a list.
- .. versionadded:: 6.0
- .. versionchanged:: 7.3
+ .. version-added:: 6.0
+ .. version-changed:: 7.3
Prioritize -namespaces options to solve problems with several
generators like -newpages/-random/-randomredirect/-linter
"""
@@ -969,7 +969,7 @@
can try parsing the argument. Call getCombinedGenerator() after all
arguments have been parsed to get the final output generator.
- .. versionadded:: 6.0
+ .. version-added:: 6.0
renamed from ``handleArg``
:param arg: Pywikibot argument consisting of -name:value
diff --git a/pywikibot/pagegenerators/_generators.py b/pywikibot/pagegenerators/_generators.py
index 6286bca..256a9ae 100644
--- a/pywikibot/pagegenerators/_generators.py
+++ b/pywikibot/pagegenerators/_generators.py
@@ -52,7 +52,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Iterate Page objects for all titles in a single namespace.
- .. deprecated:: 10.0
+ .. version-deprecated:: 10.0
The *includeredirects* parameter; use *filterredir* instead.
.. seealso:: :meth:`APISite.allpages()
<pywikibot.site._generators.GeneratorsMixin.allpages>`
@@ -112,7 +112,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Prefixed Page generator.
- .. deprecated:: 10.0
+ .. version-deprecated:: 10.0
The *includeredirects* parameter; use *filterredir* instead.
:param prefix: The prefix of the pages.
@@ -225,13 +225,13 @@
For keyword parameters refer :meth:`APISite.recentchanges()
<pywikibot.site._generators.GeneratorsMixin.recentchanges>`.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
The YieldType depends on namespace. It can be
:class:`pywikibot.Page<pywikibot.page.Page>`,
:class:`pywikibot.User<pywikibot.page.User>`,
:class:`pywikibot.FilePage<pywikibot.page.FilePage>` or
:class:`pywikibot.Category<pywikibot.page.Category>`.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
Ignore :class:`pywikibot.FilePage<pywikibot.page.FilePage>` if it
raises a :exc:`ValueError` during upcast e.g. due to an invalid
file extension.
@@ -282,7 +282,7 @@
) -> Iterable[pywikibot.page.Page]:
"""Iterate Page objects for all unconnected pages to a Wikibase repository.
- .. versionchanged::
+ .. version-changed::
The *strict* parameter was added.
:param site: Site for generator results.
@@ -820,7 +820,7 @@
) -> Iterable[pywikibot.page.Page]:
r"""Yield pages from the MediaWiki internal search engine.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
Keyword arguments *content*, *sort* and *where* was added.
.. seealso:: :meth:`site.search()
@@ -884,9 +884,9 @@
generator prints a warning for each query.
.. seealso:: https://policies.google.com/terms
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
``googlesearch-python`` package is needed instead of ``google``,
see :phab:`T387618` for further informations. The *total*
parameter was added. The *query* parameter is positional only.
@@ -933,7 +933,7 @@
.. important:: These note are from 2014 and have not been
reviewed or updated since then.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
*query* is positional only; *kwargs* parameter was added.
:param query: the text to search for.
@@ -957,9 +957,9 @@
def generator(self) -> Generator[pywikibot.page.Page]:
"""Yield results from :meth:`queryGoogle` query.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
changed from iterator method to generator property
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
use :meth:`site.protocol
<pywikibot.site._basesite.BaseSite.protocol>` to get the base
URL. Also filter duplicates.
@@ -994,7 +994,7 @@
:class:`pagegenerators.GeneratorFactory` to circumvent call of
:func:`itertools.islice` filter for this generator.
- .. versionadded:: 10.1
+ .. version-added:: 10.1
"""
self.limit = value
@@ -1087,7 +1087,7 @@
FROM page
LIMIT 10
- .. versionadded:: 9.2
+ .. version-added:: 9.2
:param query: the SQL query string.
:param site: Site for generator results.
@@ -1163,7 +1163,7 @@
"""Xml iterator that yields Page objects.
- .. versionadded:: 7.2
+ .. version-added:: 7.2
the `content` parameter
:param filename: filename of XML dump
@@ -1351,8 +1351,8 @@
"""Queries PetScan to generate pages.
.. seealso:: https://petscan.wmflabs.org/
- .. versionadded:: 3.0
- .. versionchanged:: 7.6
+ .. version-added:: 3.0
+ .. version-changed:: 7.6
subclassed from :class:`tools.collections.GeneratorWrapper`
"""
@@ -1421,7 +1421,7 @@
def query(self) -> Generator[dict[str, Any]]:
"""Query PetScan.
- .. versionchanged:: 7.4
+ .. version-changed:: 7.4
raises :class:`APIError` if query returns an error message.
:raises ServerError: Either ReadTimeout or server status error
@@ -1450,7 +1450,7 @@
def generator(self) -> Generator[pywikibot.page.Page]:
"""Yield results from :meth:`query`.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
changed from iterator method to generator property
"""
for raw_page in self.query():
@@ -1463,7 +1463,7 @@
"""Queries PagePile to generate pages.
.. seealso:: https://pagepile.toolforge.org/
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
def __init__(self, id: int) -> None:
diff --git a/pywikibot/plural.py b/pywikibot/plural.py
index 081a454..dff26f1 100644
--- a/pywikibot/plural.py
+++ b/pywikibot/plural.py
@@ -114,6 +114,6 @@
def plural_rule(lang: str) -> PluralRule:
"""Return the plural rule for a given lang.
- .. versionadded:: 4.3
+ .. version-added:: 4.3
"""
return plural_rules.get(lang, plural_rules['_default'])
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index 5a9fd4d..ab8c360 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -122,7 +122,7 @@
>>> a.value
'A123'
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
def __init__(self, attr, value) -> None:
@@ -168,7 +168,7 @@
"""A descriptor tag.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
def __init__(self) -> None:
@@ -253,8 +253,8 @@
>>> 'step' in tp
False
- .. versionadded:: 8.0
- .. versionchanged:: 8.1
+ .. version-added:: 8.0
+ .. version-changed:: 8.1
*text* parameter is defaulted to ``'<pages />'``.
"""
@@ -801,7 +801,7 @@
def _url_image_lt_140(self) -> str:
"""Get the file url of the scan of ProofreadPage.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
:return: file url of the scan ProofreadPage or None.
@@ -838,7 +838,7 @@
def _url_image_ge_140(self) -> str:
"""Get the file url of the scan of ProofreadPage.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
:return: file url of the scan of ProofreadPage or None.
:raises ValueError: in case of no image found for scan
@@ -969,9 +969,9 @@
.. warning:: It is the user's responsibility to reset quality
level accordingly.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
default for *ocr_tool* is `wmfOCR`.
- .. versionremoved:: 9.2
+ .. version-removed:: 9.2
`phetools` support is not available anymore.
:param ocr_tool: 'wmfOCR' or 'googleOCR'; default is 'wmfOCR'
@@ -1258,7 +1258,7 @@
Range is [start ... end], extremes included.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
The *content* parameter was removed
:param start: first page, defaults to 1
diff --git a/pywikibot/scripts/__init__.py b/pywikibot/scripts/__init__.py
index 415cf12..ce11239 100644
--- a/pywikibot/scripts/__init__.py
+++ b/pywikibot/scripts/__init__.py
@@ -1,7 +1,7 @@
"""Folder which holds framework scripts.
-.. versionadded:: 7.0
-.. versionremoved:: 9.4
+.. version-added:: 7.0
+.. version-removed:: 9.4
``preload_sites`` script, previously added in release 6.0
(:phab:`T226157`), was removed (:phab:`T348925`).
"""
@@ -18,8 +18,8 @@
def _import_with_no_user_config(*import_args):
"""Return ``__import__(*import_args)`` without loading user config.
- .. versionadded:: 3.0
- .. versionchanged:: 7.0
+ .. version-added:: 3.0
+ .. version-changed:: 7.0
moved to pywikibot.scripts
"""
orig_no_user_config = getenv('PYWIKIBOT_NO_USER_CONFIG')
diff --git a/pywikibot/scripts/generate_family_file.py b/pywikibot/scripts/generate_family_file.py
index 72c7d2c..80b7e5c 100755
--- a/pywikibot/scripts/generate_family_file.py
+++ b/pywikibot/scripts/generate_family_file.py
@@ -22,13 +22,13 @@
This will create the file mywiki_family.py in families folder of your
base directory.
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
moved to pywikibot.scripts folder; create family files in families
folder of your base directory instead of pywikibot/families.
-.. versionchanged:: 8.1
+.. version-changed:: 8.1
[s]trict can be given for <dointerwiki> parameter to ensure that
sites are from the given domain.
-.. versionchanged:: 8.4
+.. version-changed:: 8.4
If the url scheme is missing, ``https`` will be used.
"""
#
@@ -171,7 +171,7 @@
def getlangs(self, w) -> None:
"""Determine site code of a family.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
with [e]dit the interwiki list can be given delimited by
space or comma or both. With [s]trict only sites with the
same domain are collected. A [h]elp answer was added to show
diff --git a/pywikibot/scripts/generate_user_files.py b/pywikibot/scripts/generate_user_files.py
index 9bc7268..019d05d 100755
--- a/pywikibot/scripts/generate_user_files.py
+++ b/pywikibot/scripts/generate_user_files.py
@@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""Script to create user-config.py. Other file names are not supported.
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
moved to pywikibot.scripts folder.
-.. versionchanged:: 8.0
+.. version-changed:: 8.0
let user the choice which section to be copied.
Also EXTERNAL EDITOR SETTINGS section can be copied.
-.. versionchanged:: 10.7.1
+.. version-changed:: 10.7.1
Default ``PASS_BASENAME`` was changed from ``user-password.py`` to
``user-password.cfg``
"""
@@ -265,7 +265,7 @@
def copy_sections(force: bool = False, default: str = 'n') -> str | None:
"""Take config sections and copy them to user-config.py.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*force* and *default* options were added.
:param force: Copy all sections if force is True
@@ -299,7 +299,7 @@
default: str = 'n') -> list[str]:
"""Ask for settings to copy.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
:param variant: Variant of the setting section. Either 'framework'
or 'scripts'
diff --git a/pywikibot/scripts/login.py b/pywikibot/scripts/login.py
index 74c1583..b3656fc 100755
--- a/pywikibot/scripts/login.py
+++ b/pywikibot/scripts/login.py
@@ -42,13 +42,13 @@
To log out, throw away the ``*.lwp`` file that is created in the data
subdirectory.
-.. versionchanged:: 7.4
+.. version-changed:: 7.4
moved to :mod:`pywikibot.scripts` folder.
-.. versionchanged:: 7.7
+.. version-changed:: 7.7
*-async* option was added.
-.. versionchanged:: 10.2
+.. version-changed:: 10.2
wildcard site codes in ``usernames`` dict are supported.
-.. versionchanged:: 10.3
+.. version-changed:: 10.3
the -cookies option
"""
#
diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py
index 487bcab..08bb12b 100755
--- a/pywikibot/scripts/shell.py
+++ b/pywikibot/scripts/shell.py
@@ -13,7 +13,7 @@
python pwb.py shell [args]
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
moved to pywikibot.scripts
"""
# (C) Pywikibot team, 2014-2025
@@ -29,7 +29,7 @@
def main(*args: str) -> None:
"""Script entry point.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*exitmsg* was added for :func:`code.interact`.
"""
args = list(args)
diff --git a/pywikibot/scripts/version.py b/pywikibot/scripts/version.py
index 661432b..a1196ce 100755
--- a/pywikibot/scripts/version.py
+++ b/pywikibot/scripts/version.py
@@ -6,11 +6,11 @@
-nouser do not print usernames; otherwise they are printed for each
registered family
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
version script was moved to the framework scripts folder.
-.. versionadded:: 9.1.2
+.. version-added:: 9.1.2
the *-nouser* option was added.
-.. versionchanged:: 10.6
+.. version-changed:: 10.6
The User-Agent string is now printed for the default site. To print
it for another site, call the ``pwb`` wrapper with the global option,
e.g.:
@@ -76,7 +76,7 @@
def main(*args: str) -> None:
"""Print pywikibot version and important settings.
- .. versionchanged:: 9.1.2
+ .. version-changed:: 9.1.2
usernames are not printed with ``-nouser`` option.
"""
pywikibot.info('Pywikibot: ' + getversion())
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 906c8a1..aa95efd 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -32,14 +32,14 @@
python pwb.py -lang:de bot_tests -v
.. seealso:: :mod:`pwb` entry point
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
pwb wrapper was added to the Python site package lib.
-.. versionchanged:: 7.7
+.. version-changed:: 7.7
pwb wrapper is able to set ``PYWIKIBOT_TEST_...`` environment variables,
see :ref:`Environment variables`.
-.. versionchanged:: 8.0
+.. version-changed:: 8.0
renamed to wrapper.py.
-.. versionchanged:: 9.4
+.. version-changed:: 9.4
enable external scripts via entry points.
"""
#
@@ -116,7 +116,7 @@
def run_python_file(filename: str, args: list[str], package=None) -> None:
"""Run a python file as if it were the main program on the command line.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
Set and restore ``PYWIKIBOT_TEST_...`` environment variables.
:param filename: The path to the file to execute, it need not be a
@@ -178,7 +178,7 @@
) -> tuple[str, list[str], list[str], list[str]]:
"""Handle args and get filename.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
Catch ``PYWIKIBOT_TEST_...`` environment variables.
:return: filename, script args, local pwb args, environment variables
@@ -391,11 +391,11 @@
def find_filename(filename):
"""Search for the filename in the given script paths.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
Search users_scripts_paths in config.base_dir
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Add config.base_dir to search path
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
Search in entry point paths
"""
from pywikibot import config
@@ -474,7 +474,7 @@
def execute() -> bool:
"""Parse arguments, extract filename and run the script.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
renamed from :func:`main`
"""
global filename
@@ -541,7 +541,7 @@
def main() -> None:
"""Script entry point. Print doc if necessary.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
previous implementation was renamed to :func:`execute`
"""
if not check_modules():
@@ -554,7 +554,7 @@
def run() -> None: # pragma: no cover
"""Site package entry point. Print doc if necessary.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
global site_package
site_package = True
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 8664488..eb8c4a1 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -200,7 +200,7 @@
) -> BaseSite:
"""Create a site from a database name using the sitematrix.
- .. versionchanged:: 8.3.3
+ .. version-changed:: 8.3.3
changed from classmethod to staticmethod.
:param dbname: database name
@@ -305,7 +305,7 @@
def simple_request(self, **kwargs: Any) -> api.Request:
"""Create a request by defining all kwargs as parameters.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
`_simple_request` becomes a public method
"""
return self._request_class({'parameters': kwargs}).create_simple(
@@ -342,9 +342,9 @@
) -> None:
"""Log the user in if not already logged in.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
lazy load cookies when logging in. This was dropped in 8.0.4
- .. versionchanged:: 8.0.4
+ .. version-changed:: 8.0.4
the *cookie_only* parameter was added and cookies are loaded
whenever the site is initialized.
@@ -487,8 +487,8 @@
def file_extensions(self) -> list[str]:
"""File extensions enabled on the wiki.
- .. versionadded:: 8.4
- .. versionchanged:: 9.2
+ .. version-added:: 8.4
+ .. version-changed:: 9.2
also include extensions from the image repository
"""
ext = self.siteinfo.get('fileextensions')
@@ -500,7 +500,7 @@
def maxlimit(self) -> int:
"""Get the maximum limit of pages to be retrieved.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
parameter = self._paraminfo.parameter('query+info', 'prop')
assert parameter is not None
@@ -587,7 +587,7 @@
.. seealso::
- :class:`tools.collections.RateLimit` for RateLimit examples.
- :api:`Ratelimit`
- .. versionadded:: 9.0
+ .. version-added:: 9.0
:param action: action which might be limited
:return: RateLimit tuple with ``group``, ``hits`` and ``seconds``
@@ -648,7 +648,7 @@
- :meth:`logged_in` to verify the user is loggend in to a site
.. seealso:: :api:`Userinfo`
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Use API formatversion 2.
:return: A dict with the following keys and values:
@@ -683,7 +683,7 @@
def userinfo(self) -> None:
"""Delete cached userinfo.
- .. versionadded:: 5.5
+ .. version-added:: 5.5
"""
if hasattr(self, '_userinfo'):
del self._userinfo
@@ -693,7 +693,7 @@
force: bool = False) -> dict[str, Any]:
"""Retrieve globaluserinfo from site and cache it.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:param user: The user name or user ID whose global info is
retrieved. Defaults to the current user.
@@ -747,7 +747,7 @@
To get globaluserinfo for a given user or user ID use
:meth:`get_globaluserinfo` method instead
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
return self.get_globaluserinfo()
@@ -755,7 +755,7 @@
def globaluserinfo(self) -> None:
"""Delete cached globaluserinfo of current user.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
username = self.username()
assert username is not None
@@ -770,7 +770,7 @@
.. seealso:: :api:`Userinfo`
- .. versionadded:: 7.0
+ .. version-added:: 7.0
The `force` parameter
:param force: Whether the cache should be discarded.
@@ -784,7 +784,7 @@
force: bool = False) -> bool:
"""Return True when given user is locked globally.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:param user: The user name or user ID. Defaults to the current
user.
@@ -832,9 +832,9 @@
Replaces the ``$1`` placeholder from MediaWiki with a
Python-compatible ``{}``.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
raises ValueError instead of AttributeError if "$1"
placeholder is missing.
@@ -853,7 +853,7 @@
Letters that can follow a wikilink and are regarded as part of
this link. This depends on the linktrail setting in LanguageXx.php
- .. versionadded:: 7.3
+ .. version-added:: 7.3
:return: The linktrail regex.
"""
@@ -1155,7 +1155,7 @@
:meth:`BaseSite.redirects()
<pywikibot.site._basesite.BaseSite.redirects>`
- .. versionadded:: 8.4
+ .. version-added:: 8.4
"""
return [s.lstrip('#') for s in self.getmagicwords('redirect')]
@@ -1357,7 +1357,7 @@
>>> page is None
True
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
No longer raise NotimplementedError if used with a Wikibase
site.
@@ -1398,7 +1398,7 @@
If optional argument *all_ns* is true, return all recognized
values for this namespace.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*all* parameter was renamed to *all_ns*.
:param num: Namespace constant.
@@ -1490,9 +1490,9 @@
.. note:: Parameters validation and error handling left to the
API call.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*mediatype* and *bitdepth* properties were added.
- .. versionchanged:: 8.6.
+ .. version-changed:: 8.6.
Added *timestamp* parameter.
Metadata are loaded only if *history* is False.
.. seealso:: :api:`Imageinfo`
@@ -1588,7 +1588,7 @@
) -> pywikibot.page.Page:
"""Return page object for the redirect target of page.
- .. versionadded:: 9.3
+ .. version-added:: 9.3
*ignore_section* parameter
.. seealso:: :meth:`page.BasePage.getRedirectTarget`
@@ -1719,10 +1719,10 @@
You should not call this method directly, especially if you only
need a specific token. Use :attr:`tokens` property instead.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*all* parameter is deprecated. Use an empty list for
``types`` instead.
- .. versionchanged:: 11.0
+ .. version-changed:: 11.0
*all* parameter was removed.
.. seealso:: :api:`Tokens`
@@ -1780,7 +1780,7 @@
'1c8...9d3+\\'
>>> del site.tokens # another variant to clear the cache
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
``tokens`` attribute became a property to enable deleter.
.. warning:: A deprecation warning is shown if the token name is
outdated, see :api:`Tokens (action)`.
@@ -1797,7 +1797,7 @@
def get_parsed_page(self, page: BasePage) -> str:
"""Retrieve parsed text of the page using action=parse.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
raises KeyError instead of AssertionError
.. seealso::
@@ -1865,7 +1865,7 @@
If more than one target id is provided, the same action is taken for
all of them.
- .. versionadded:: 6.0
+ .. version-added:: 6.0
:param targettype: Type of target. One of "archive", "filearchive",
"logging", "oldimage", "revision".
@@ -2385,7 +2385,7 @@
.. seealso:: :api:`Move`
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
The `movesubpages` parameter was added
:param page: the Page to be moved (must exist)
@@ -2496,7 +2496,7 @@
will revert the last edit(s) made by the specified user on the
given page.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
Added *pageid* as alternative to *page* (one must be given).
*markbot* defaults to True if the rollbacker is a bot and not
explicitly given. The method now returns a dictionary with
@@ -2628,16 +2628,16 @@
To delete a specific version of an image the oldimage identifier
must be provided.
- .. versionadded:: 6.1
+ .. version-added:: 6.1
renamed from `deletepage`
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
keyword only parameter `oldimage` was added.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
keyword only parameter `deletetalk` was added.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
raises :exc:`exceptions.NoPageError` if page does not exist.
:param page: Page to be deleted or its pageid.
@@ -2717,10 +2717,10 @@
.. seealso:: :api:`Undelete`
- .. versionadded:: 6.1
+ .. version-added:: 6.1
renamed from `undelete_page`
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
`fileids` parameter was added,
keyword argument required for `revisions`.
@@ -2770,7 +2770,7 @@
>>> sorted(site.protection_types())
['create', 'edit', 'move', 'upload']
- .. deprecated:: 10.5
+ .. version-deprecated:: 10.5
Use :attr:`restrictions[types]<restrictions>` instead.
:return: protection types available
@@ -2787,7 +2787,7 @@
>>> sorted(site.protection_levels())
['', 'autoconfirmed', ... 'sysop', 'templateeditor']
- .. deprecated:: 10.5
+ .. version-deprecated:: 10.5
Use :attr:`restrictions[levels]<restrictions>` instead.
:return: protection levels available
@@ -2807,7 +2807,7 @@
>>> sorted(r['levels'])
['', 'autoconfirmed', ... 'sysop', 'templateeditor']
- .. versionadded:: 10.5
+ .. version-added:: 10.5
.. seealso:: :meth:`page_restrictions`
:return: dict with keys 'types', 'levels', 'cascadinglevels' and
@@ -2978,7 +2978,7 @@
) -> bool:
"""Add or remove pages from watchlist.
- .. versionchanged:: 10.4.0
+ .. version-changed:: 10.4.0
Added the *expiry* parameter to specify watch expiry time.
Passing *unwatch* as a positional parameter is deprecated;
it must be passed as keyword argument.
@@ -3122,10 +3122,10 @@
Either source_filename or source_url, but not both, must be provided.
- .. versionchanged:: 6.0
+ .. version-changed:: 6.0
keyword arguments required for all parameters except `filepage`
- .. versionchanged:: 6.2:
+ .. version-changed:: 6.2:
asynchronous upload is used if `asynchronous` parameter is set.
For keyword arguments refer :class:`pywikibot.site._upload.Uploader`
diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py
index 24bdcbe..caa3e55 100644
--- a/pywikibot/site/_basesite.py
+++ b/pywikibot/site/_basesite.py
@@ -185,7 +185,7 @@
def __getattr__(self, name: str):
"""Delegate undefined methods calls to the Family object.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Only delegate to public Family methods which have ``code`` as
first parameter.
"""
@@ -225,7 +225,7 @@
def languages(self) -> list[str]:
"""Return list of all valid site codes for this site's Family.
- .. deprecated:: 9.6
+ .. version-deprecated:: 9.6
Use :meth:`codes` instead.
"""
return sorted(self.codes)
@@ -234,7 +234,7 @@
def codes(self) -> set[str]:
"""Return set of all valid site codes for this site's Family.
- .. versionadded:: 9.6
+ .. version-added:: 9.6
.. seealso:: :attr:`family.Family.codes`
"""
return set(self.family.langs.keys())
@@ -274,7 +274,7 @@
def redirect(self) -> str:
"""Return a default redirect tag for the site.
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
return a single generic redirect tag instead of a list of
tags. For the list use :meth:`redirects` instead.
"""
@@ -284,7 +284,7 @@
"""Return list of generic redirect tags for the site.
.. seealso:: :meth:`redirect` for the default redirect tag.
- .. versionadded:: 8.4
+ .. version-added:: 8.4
"""
return ['REDIRECT']
@@ -375,7 +375,7 @@
arbitrary stuff, then a wikilink. The wikilink may contain a
label, although this is not useful.
- .. versionadded:: 8.4
+ .. version-added:: 8.4
moved from class:`APISite<pywikibot.site._apisite.APISite>`
"""
tags = '|'.join(self.redirects())
diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py
index 6cb87db..8e86078b 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -58,7 +58,7 @@
support that entity type either.
.. seealso:: https://www.mediawiki.org/wiki/Wikibase/Federation
- .. versionadded:: 8.0
+ .. version-added:: 8.0
:raises ValueError: when invalid entity type was provided
"""
@@ -244,7 +244,7 @@
This is used specifically because we can cache the value for a
much longer time (near infinite).
- .. versionadded:: 9.5
+ .. version-added:: 9.5
:raises NoWikibaseEntityError: *prop* does not exist
"""
@@ -274,7 +274,7 @@
def getPropertyType(self, prop):
"""Obtain the type of a property.
- .. deprecated:: 9.5
+ .. version-deprecated:: 9.5
Use :meth:`get_property_type` instead.
"""
try:
@@ -294,7 +294,7 @@
``item`` if dict with API parameters was passed to *entity*
parameter.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* keyword argument was added
:param entity: Page to edit, or dict with API parameters
@@ -360,7 +360,7 @@
tags: str | None = None) -> None:
"""Add a claim.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
:param entity: Entity to modify
@@ -397,7 +397,7 @@
tags: str | None = None):
"""Set the claim target to the value of the provided claim target.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
:param claim: The source of the claim target value
@@ -439,7 +439,7 @@
tags: str | None = None):
"""Save the whole claim to the wikibase site.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
:param claim: The claim to save
@@ -482,9 +482,9 @@
tags: str | None = None):
"""Create/Edit a source.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
deprecated *baserevid* parameter was removed
:param claim: A Claim object to add the source to.
@@ -542,9 +542,9 @@
tags: str | None = None):
"""Create/Edit a qualifier.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
deprecated *baserevid* parameter was removed
:param claim: A Claim object to add the qualifier to
@@ -591,9 +591,9 @@
tags: str | None = None):
"""Remove claims.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
deprecated *baserevid* parameter was removed
:param claims: Claims to be removed
@@ -628,9 +628,9 @@
tags: str | None = None):
"""Remove sources.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
deprecated `baserevid` parameter was removed
:param claim: A Claim object to remove the sources from
@@ -662,9 +662,9 @@
tags: str | None = None):
"""Remove qualifiers.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
deprecated `baserevid` parameter was removed
:param claim: A Claim object to remove the qualifier from
@@ -694,7 +694,7 @@
bot: bool = True) -> dict:
"""Link two pages together.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
:param page1: First page to link
@@ -725,7 +725,7 @@
tags: str | None = None) -> dict:
"""Merge two items together.
- .. versionchanged:: 9.4
+ .. version-changed:: 9.4
*tags* parameter was added
:param from_item: Item to merge from
@@ -836,7 +836,7 @@
validate: bool = False) -> list[Any]:
"""Send data values to the wikibase parser for interpretation.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
.. seealso:: `wbparsevalue API
<https://www.wikidata.org/w/api.php?action=help&modules=wbparsevalue>`_
diff --git a/pywikibot/site/_extensions.py b/pywikibot/site/_extensions.py
index 2e24b85..cca170d 100644
--- a/pywikibot/site/_extensions.py
+++ b/pywikibot/site/_extensions.py
@@ -183,7 +183,7 @@
Load URLs to images for a given page in the "Page:" namespace.
No effect for pages in other namespaces.
- .. versionadded:: 8.6
+ .. version-added:: 8.6
.. seealso:: :api:`imageforpage`
"""
@@ -302,7 +302,7 @@
.. warning:: The retrieved pages may be connected in meantime.
To avoid this, use *strict* parameter to check.
- .. versionchanged::
+ .. version-changed::
The *strict* parameter was added.
:param total: Maximum number of pages to return, or ``None`` for
@@ -435,7 +435,7 @@
"""APISite mixin for TextExtracts extension.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
"""
@need_extension('TextExtracts')
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index 8b15ad1..599b192 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -134,11 +134,11 @@
pagelist. In case of duplicates in a groupsize batch, return the
first entry.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
*content* parameter was added.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
*categories* parameter was added.
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
*groupsize* is maxlimit by default. *quiet* parameter was
added. No longer show the "Retrieving pages from site"
message by default.
@@ -354,7 +354,7 @@
.. seealso:: :api:`Redirects`
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:param page: The Page to get redirects for.
:param filter_fragments: If True, only return redirects with fragments.
@@ -459,7 +459,7 @@
) -> Iterable[pywikibot.Page]:
"""Iterate categories to which page belongs.
- .. versionadded:: 9.6
+ .. version-added:: 9.6
the *with_sort_key* parameter.
.. seealso::
@@ -581,9 +581,9 @@
- :meth:`pywikibot.Category.members`
- :meth:`pywikibot.Category.subcategories`
- .. versionchanged:: 4.0
+ .. version-changed:: 4.0
parameters except *category* are keyword arguments only.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
raises TypeError instead of Error if no Category is specified
.. seealso:: :api:`Categorymembers`
@@ -874,7 +874,7 @@
) -> Generator[pywikibot.Link]:
"""Yield all interlanguage links on page, yielding Link objects.
- .. versionchanged:: 6.2:
+ .. version-changed:: 6.2:
`include_empty_titles` parameter was added.
.. seealso:: :api:`Langlinks`
@@ -1291,7 +1291,7 @@
"""Iterate Pages that contain links to the given FilePage.
.. seealso:: :api:`Imageusage`
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
all parameters except `image` are keyword only.
:param image: the image to search for (FilePage need not exist on
@@ -1400,7 +1400,7 @@
) -> Iterable[dict[str, Any]]:
"""Iterate recent changes.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
*page* parameter was added.
.. seealso:: :api:`RecentChanges`
@@ -1492,13 +1492,13 @@
Note that this may include non-existing Pages if the wiki's
database table contains outdated entries.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
Default of `where` parameter has been changed from 'text' to
None. The behaviour depends on the installed search engine
which is 'text' on CirrusSearch'.
raises APIError instead of Error if searchstring is not set
or what parameter is wrong.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
The *sort* parameter was added.
.. seealso:: :api:`Search`
@@ -1833,7 +1833,7 @@
random.
.. seealso:: :api:`Random`
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Raises ``TypeError`` instead of ``AssertionError`` if
*redirects* is invalid.
@@ -2022,7 +2022,7 @@
API.
.. seealso:: :api:`Querypage`
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Raises ``ValueError`` instead of ``AssertionError`` if
*special_page* is invalid.
@@ -2274,7 +2274,7 @@
:py:obj:`APISite.allpages`, while it uses for 'create' the
'query+protectedtitles' module.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*type* parameter was renamed to *protect_type*.
.. seealso:: :api:`Protectedtitles`
@@ -2330,7 +2330,7 @@
.. note:: ``watched_pages`` is a restartable generator. See
:class:`tools.collections.GeneratorWrapper` for its usage.
.. seealso:: :api:`Watchlistraw`
- .. versionadded:: 8.1
+ .. version-added:: 8.1
the *with_talkpage* parameter.
:param force: Reload watchlist
diff --git a/pywikibot/site/_namespace.py b/pywikibot/site/_namespace.py
index d31b4d2..1f96864 100644
--- a/pywikibot/site/_namespace.py
+++ b/pywikibot/site/_namespace.py
@@ -49,7 +49,7 @@
def canonical(self) -> str:
"""Canonical form of MediaWiki built-in namespace.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
"""
name = '' if self == 0 else self.name.capitalize().replace('_', ' ')
return name.replace('Mediawiki', 'MediaWiki')
@@ -59,7 +59,7 @@
"""Metaclass for Namespace attribute settings.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
def __new__(cls, name, bases, dic):
@@ -86,7 +86,7 @@
If only one of canonical_name and custom_name are available, both
properties will have the same value.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
metaclass from :class:`MetaNamespace`
"""
@@ -149,7 +149,7 @@
def canonical_namespaces(cls) -> dict[int, str]:
"""Return the canonical forms of MediaWiki built-in namespaces.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
implemented as classproperty using BuiltinNamespace IntEnum.
"""
return {item.value: item.canonical for item in BuiltinNamespace}
@@ -188,7 +188,7 @@
This method is implemented to be independent from __len__ method.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
:return: Always return True like generic object class.
"""
diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py
index b428850..3a4f4fe 100644
--- a/pywikibot/site/_siteinfo.py
+++ b/pywikibot/site/_siteinfo.py
@@ -32,7 +32,7 @@
All values of the 'general' property are directly available.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
formatversion 2 is used for API calls.
.. admonition:: Compatibility note
@@ -50,7 +50,7 @@
:code:`'thumblimits': [120, 150, 180, 200, 220, 250, 300, 400]`
- .. deprecated:: 10.5
+ .. version-deprecated:: 10.5
Accessing the fallback '*' keys in 'languages', 'namespaces',
'namespacealiases', and 'skins' properties are deprecated and
will be removed in a future release of Pywikibot.
@@ -70,7 +70,7 @@
def clear(self) -> None:
"""Clear all cached siteinfo properties.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
"""
self._cache.clear()
@@ -81,7 +81,7 @@
Modifies *data* in place.
- .. versionchanged:: 10.5
+ .. version-changed:: 10.5
Modify *data* for formatversion 1 compatibility and easier
to use lists.
@@ -333,7 +333,7 @@
def is_cached(self, key: str) -> bool:
"""Return whether the value is cached.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
"""
try:
self._get_cached(key)
@@ -349,7 +349,7 @@
like `key in container`.Only string keys are valid. Non-string
keys always return False.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
Previous implementation only checked for cached keys.
:param key: The key to check for presence. Should be a string.
diff --git a/pywikibot/site/_tokenwallet.py b/pywikibot/site/_tokenwallet.py
index d2410da..8e93b5d 100644
--- a/pywikibot/site/_tokenwallet.py
+++ b/pywikibot/site/_tokenwallet.py
@@ -34,7 +34,7 @@
def __getitem__(self, key: str) -> str:
"""Get token value for the given key.
- .. versionchanged:: 11.0
+ .. version-changed:: 11.0
Support of legacy API tokens was dropped.
"""
if self.site.user() is None and key != 'login':
@@ -77,7 +77,7 @@
>>> repr(site.tokens)
"TokenWallet(pywikibot.Site('wikipedia:test'))"
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Provide a string which looks like a valid Python expression.
"""
user = f', user={self._currentuser!r}' if self._currentuser else ''
@@ -87,7 +87,7 @@
def clear(self) -> None:
"""Clear the self._tokens cache. Tokens are reloaded when needed.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
self._tokens.clear()
@@ -111,7 +111,7 @@
r._params['token'] = r.site.tokens.update_tokens(r._params['token'])
- .. versionadded:: 8.0
+ .. version-added:: 8.0
:param tokens: A list of token types that need to be updated.
:return: A list of updated tokens corresponding to the given
diff --git a/pywikibot/site/_upload.py b/pywikibot/site/_upload.py
index 9ce19a1..3d4c44b 100644
--- a/pywikibot/site/_upload.py
+++ b/pywikibot/site/_upload.py
@@ -23,7 +23,7 @@
"""Uploader class to upload a file to the wiki.
- .. versionadded:: 7.1
+ .. version-added:: 7.1
:param site: The current site to work on
:param filepage: a FilePage object from which the wiki-name of the
diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index 97f59d3..0ccd9c3 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -275,11 +275,11 @@
def check_response(response) -> None:
"""Raise ClientError or ServerError depending on http status.
- .. versionadded:: 3.0
- .. versionchanged:: 7.0
+ .. version-added:: 3.0
+ .. version-changed:: 7.0
Raise a generic :class:`exceptions.ServerError` if http status
code is not IANA-registered but unofficial code
- .. versionchanged:: 8.1
+ .. version-changed:: 8.1
Raise a :class:`exceptions.ClientError` if status code is 4XX
"""
for status_code, err_class, err_type in [
diff --git a/pywikibot/specialbots/_upload.py b/pywikibot/specialbots/_upload.py
index d25a859..d65602c 100644
--- a/pywikibot/specialbots/_upload.py
+++ b/pywikibot/specialbots/_upload.py
@@ -48,7 +48,7 @@
bot.post_processor = summarize
bot.run()
- .. versionadded:: 9.1
+ .. version-added:: 9.1
"""
def __init__(self, url: list[str] | str, *,
@@ -68,9 +68,9 @@
**kwargs) -> None:
"""Initializer.
- .. versionchanged:: 6.2
+ .. version-changed:: 6.2
asynchronous upload is used if *asynchronous* parameter is set
- .. versionchanged:: 6.4
+ .. version-changed:: 6.4
*force_if_shared* parameter was added
:param url: path to url or local file, or list of urls or paths
@@ -239,7 +239,7 @@
def process_filename(self, file_url: str) -> str | None:
"""Return base filename portion of *file_url*.
- .. versionchanged:: 10.2
+ .. version-changed:: 10.2
no longer shows the description if UploadRobot's parameter
*verify_description* is set to False.
@@ -394,7 +394,7 @@
If the upload fails, ask the user whether to try again or not.
If the user chooses not to retry, return None.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
If 'copyuploadbaddomain' API error occurred in first step,
download the file and upload it afterwards
@@ -473,7 +473,7 @@
def run(self) -> None:
"""Run bot.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
count uploads.
"""
if self.skip_run():
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index e9267ee..1915019 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -117,7 +117,7 @@
languages, and that it returns an unchanged string if an
unsupported language is given.
- .. versionchanged:: 7.5
+ .. version-changed:: 7.5
always return a string even `phrase` is an int.
:param phrase: The phrase to convert to localized numerical
@@ -136,8 +136,8 @@
langs: Sequence[str] | str | None = None) -> str:
"""Change non-ascii digits to ascii digits.
- .. versionadded:: 7.0
- .. versionchanged:: 10.3
+ .. version-added:: 7.0
+ .. version-changed:: 10.3
this function was renamed from to_latin_digits.
:param phrase: The phrase to convert to ascii numerical.
@@ -161,8 +161,8 @@
def case_escape(case: str, string: str, *, underscore: bool = False) -> str:
"""Return an escaped regex pattern which depends on 'first-letter' case.
- .. versionadded:: 7.0
- .. versionchanged:: 8.4
+ .. version-added:: 7.0
+ .. version-changed:: 8.4
Added the optional *underscore* parameter.
:param case: if `case` is 'first-letter', the regex contains an
@@ -225,7 +225,7 @@
def ignore_case(string: str) -> str:
"""Return a case-insensitive pattern for the string.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`_ignore_case` becomes a public method
"""
return ''.join(
@@ -313,7 +313,7 @@
) -> list[re.Pattern[str]]:
"""Fetch compiled regexes.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
``_get_regexes`` becomes a public function.
*keys* may be a single string; *site* is optional.
@@ -509,7 +509,7 @@
* includeonly tags
* source and syntaxhighlight tags
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
the order of removals will correspond to the tags argument
if provided as an ordered collection (list, tuple)
@@ -563,7 +563,7 @@
.. caution:: Tag names must be given in lowercase.
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
The *removetags* parameter was added. Refactored to use
:class:`GetDataHTML` and its ``__call__`` method. tag attributes
will be kept.
@@ -637,10 +637,10 @@
.. caution:: Tag names must be given in lowercase.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
No longer a context manager
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
Public class now. Added support for removals of tag contents.
.. seealso::
@@ -708,7 +708,7 @@
listed in *removetags* begin a skip block, and their content
will be excluded from the output.
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
Keep tag attributes.
:param tag: The tag name (e.g., "div", "script") converted to
@@ -819,7 +819,7 @@
function which returns a Link instance and copies the value which should
remaining.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
`site` parameter is mandatory
:param text: the text in which to replace links
@@ -1043,7 +1043,7 @@
def add_text(text: str, add: str, *, site=None) -> str:
"""Add text to a page content above categories and interwiki.
- .. versionadded:: 6.4
+ .. version-added:: 6.4
:param text: The page content to add text to.
:param add: Text to add.
@@ -1091,7 +1091,7 @@
"""A namedtuple as part of :class:`Content` describing a page section.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
``_Section`` becomes a public class.
"""
@@ -1102,7 +1102,7 @@
def level(self) -> int:
"""Return the section level.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
"""
m = HEAD_PATTERN.match(self.title)
return len(m[1])
@@ -1111,7 +1111,7 @@
def heading(self) -> str:
"""Return the section title without equal signs.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
"""
level = self.level
return self.title[level:-level].strip()
@@ -1124,7 +1124,7 @@
Introduced for handling lists of sections with custom lookup by
:attr:`Section.heading` and :attr:`level<Section.level>`.
- .. versionadded:: 10.4
+ .. version-added:: 10.4
"""
def __contains__(self, value: object) -> bool:
@@ -1216,7 +1216,7 @@
"""A namedtuple as result of :func:`extract_sections` holding page content.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
``_Content`` becomes a public class.
"""
@@ -1230,7 +1230,7 @@
The first main title is anything enclosed within triple quotes.
- .. versionadded:: 8.2
+ .. version-added:: 8.2
"""
m = TITLE_PATTERN.search(self.header)
return m[1].strip() if m else ''
@@ -1331,11 +1331,11 @@
.. note:: sections and text from templates are not extracted but
embedded as plain text.
- .. versionadded:: 3.0
- .. versionchanged:: 8.2
+ .. version-added:: 3.0
+ .. version-changed:: 8.2
The :class:`Content` and :class:`Section` class have additional
properties.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
Added custom ``index()``, ``count()`` and ``in`` operator support
for :attr:`Content.sections`.
@@ -1512,7 +1512,7 @@
template_subpage: bool = False) -> str:
"""Replace inter-language links in the text with a new set of links.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*addOnly* was renamed to *add_only*.
:param oldtext: The text that needs to be modified.
@@ -1843,7 +1843,7 @@
add_only: bool = False) -> str:
"""Replace all existing category links with new category links.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*addOnly* was renamed to *add_only*.
:param oldtext: The text that needs to be replaced.
@@ -2046,7 +2046,7 @@
:param strip: If enabled, strip arguments and values of templates.
:return: list of template name and params
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
*wikitextparser* package is supported; either *wikitextparser* or
*mwparserfromhell* is strictly recommended.
"""
@@ -2195,7 +2195,7 @@
Attribute order is important to avoid mismatch when searching.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
time: re.Pattern[str]
@@ -2209,7 +2209,7 @@
"""Find timestamp in page and return it as pywikibot.Timestamp object.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
*group* attribute is a set instead of a list.
*patterns* is a :class:`TimeStripperPatterns` namedtuple instead
of a list.
@@ -2348,7 +2348,7 @@
All the following items must be matched, otherwise None is
returned: -. year, month, hour, time, day, minute, tzinfo
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
HTML parts are removed from line
:return: A timestamp found on the given line
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 0fe30ad..d58a5cf 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -102,7 +102,7 @@
def next_multiplicity(self) -> float:
"""Factor to scale delay time based on upcoming request size.
- .. deprecated:: 10.3.0
+ .. version-deprecated:: 10.3.0
"""
return 1.0
@@ -111,7 +111,7 @@
def next_multiplicity(self, value: float) -> None:
"""Setter for delay scaling factor for the next request.
- .. deprecated:: 10.3.0
+ .. version-deprecated:: 10.3.0
This property has no effect and is retained for backward
compatibility.
"""
@@ -120,7 +120,7 @@
def _module_hash(module: str | None = None) -> str:
"""Convert called module name to a hash.
- .. versionchanged:: 11.0
+ .. version-changed:: 11.0
Set hashlib constructor *usedforsecurity* argument to ``False``
because the hash is not used in a security context. Use ``md5``
hash algorithm for GraalPy implementation instead of
@@ -175,7 +175,7 @@
def checkMultiplicity(self) -> None:
"""Count running processes for site and set process_multiplicity.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
process is not written to throttle.ctrl file if site is empty.
"""
global pid
@@ -227,7 +227,7 @@
) -> None:
"""Set the nominal delays in seconds.
- .. deprecated:: 10.3.0
+ .. version-deprecated:: 10.3.0
Use :meth:`set_delays` instead.
"""
self.set_delays(delay=delay, writedelay=writedelay, absolute=absolute)
@@ -242,7 +242,7 @@
Defaults to config values.
- .. versionadded:: 10.3.0
+ .. version-added:: 10.3.0
Renamed from :meth:`setDelays`.
"""
with self.lock:
@@ -261,7 +261,7 @@
def getDelay(self, write: bool = False) -> float:
"""Return the current delay, adjusted for active processes.
- .. deprecated:: 10.3.0
+ .. version-deprecated:: 10.3.0
Use :meth:`get_delay` instead.
"""
return self.get_delay(write=write)
@@ -274,7 +274,7 @@
time has already passed since the last access — use
:meth:`waittime` for that.
- .. versionadded:: 10.3.0
+ .. version-added:: 10.3.0
Renamed from :meth:`getDelay`.
:param write: Whether the operation is a write (uses writedelay).
@@ -342,10 +342,10 @@
This method blocks the calling thread if the minimum delay has
not yet elapsed since the last read or write operation.
- .. versionchanged:: 10.3.0
+ .. version-changed:: 10.3.0
The *write* parameter is now keyword-only.
- .. deprecated:: 10.3.0
+ .. version-deprecated:: 10.3.0
The *requestsize* parameter has no effect and will be removed
in a future release.
diff --git a/pywikibot/time.py b/pywikibot/time.py
index 1e980b2..42706d8 100644
--- a/pywikibot/time.py
+++ b/pywikibot/time.py
@@ -1,6 +1,6 @@
"""Time handling module.
-.. versionadded:: 7.5
+.. version-added:: 7.5
"""
#
# (C) Pywikibot team, 2007-2025
@@ -28,7 +28,7 @@
'TZoneFixedOffset'
)
-#: .. versionadded:: 7.5
+#: .. version-added:: 7.5
MW_KEYS = types.MappingProxyType({
's': 'seconds',
'h': 'hours',
@@ -67,7 +67,7 @@
this is more reliable than using :meth:`Timestamp.utcnow` or
:meth:`Timestamp.nowutc`.
- .. versionchanged:: 7.5
+ .. version-changed:: 7.5
moved to :mod:`time` module
"""
@@ -88,8 +88,8 @@
- ISO8601 format: ``YYYY-MM-DD[T ]HH:MM:SS[Z|±HH[MM[SS[.ffffff]]]]``
- POSIX format: seconds from Unix epoch ``S{1,13}[.ffffff]]``
- .. versionadded:: 7.5
- .. versionchanged:: 8.0
+ .. version-added:: 7.5
+ .. version-changed:: 8.0
raises *TypeError* instead of *ValueError*.
:param ts: Timestamp, datetime.datetime or str
@@ -109,7 +109,7 @@
def _from_datetime(dt: datetime.datetime) -> Timestamp:
"""Convert a datetime.datetime timestamp to a Timestamp object.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
return Timestamp(dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second, dt.microsecond,
@@ -121,7 +121,7 @@
Mediwiki timestamp format: YYYYMMDDHHMMSS
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
RE_MW = r'\d{14}' # noqa: N806
m = re.fullmatch(RE_MW, timestr)
@@ -139,7 +139,7 @@
ISO8601 format:
``YYYY-MM-DD[T ]HH:MM:SS[[.,]ffffff][Z|±HH[MM[SS[.ffffff]]]]``
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
RE_ISO8601 = (r'(?:\d{4}-\d{2}-\d{2})(?P<sep>[T ])' # noqa: N806
r'(?:\d{2}:\d{2}:\d{2})(?P<u>[.,]\d{1,6})?'
@@ -179,7 +179,7 @@
POSIX format: ``SECONDS[.ffffff]]``
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
RE_POSIX = r'(?P<S>-?\d{1,13})(?:\.(?P<u>\d{1,6}))?' # noqa: N806
m = re.fullmatch(RE_POSIX, timestr)
@@ -202,7 +202,7 @@
def _from_string(cls, timestr: str) -> Timestamp:
"""Convert a string to a Timestamp object.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
handlers = [
cls._from_mw,
@@ -261,9 +261,9 @@
strict: bool = False) -> Timestamp:
"""Convert a MediaWiki internal timestamp to a Timestamp object.
- .. versionchanged:: 3.0
+ .. version-changed:: 3.0
create a Timestamp if only year, month and day are given.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
the *strict* parameter was added which discards missing
element tolerance.
@@ -319,21 +319,21 @@
See Note in datetime.timestamp().
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
return self.replace(tzinfo=datetime.timezone.utc).timestamp()
def posix_timestamp_format(self) -> str:
"""Convert object to a POSIX timestamp format.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
return f'{self.posix_timestamp():.6f}'
def __repr__(self) -> str:
"""Unify repr string between CPython and Pypy (T325905).
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
s = super().__repr__()
return f'{type(self).__name__}{s[s.find("("):]}'
@@ -365,7 +365,7 @@
aware Timestamps/datetimes (i.e. missing or having timezone).
A TypeError will be raised in such cases.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
.. seealso::
- :python:`datetime.now()
<library/datetime.html#datetime.datetime.now>`
@@ -411,7 +411,7 @@
.. hint::
This method might be deprecated later.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
.. seealso::
:python:`datetime.utcnow()
<library/datetime.html#datetime.datetime.utcnow>`
diff --git a/pywikibot/titletranslate.py b/pywikibot/titletranslate.py
index 1d381be..58743b7 100644
--- a/pywikibot/titletranslate.py
+++ b/pywikibot/titletranslate.py
@@ -23,7 +23,7 @@
entries such as "all:" or "xyz:" or "20:" are first built from the
page title of 'page' and then listed.
- .. versionchanged:: 9.6
+ .. version-changed:: 9.6
Raise ``RuntimeError`` instead of ``AssertionError`` if neither
*page* nor *site* parameter is given.
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 9ad6b55..5fbf0d8 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -100,7 +100,7 @@
def is_ip_address(value: str) -> bool:
"""Check if a value is a valid IPv4 or IPv6 address.
- .. versionadded:: 6.1
+ .. version-added:: 6.1
Was renamed from ``is_IP()``.
.. seealso:: :func:`is_ip_network`
@@ -116,7 +116,7 @@
def is_ip_network(value: str) -> bool:
"""Check if a value is a valid range of IPv4 or IPv6 addresses.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
.. seealso:: :func:`is_ip_address`
:param value: value to check
@@ -131,9 +131,9 @@
def has_module(module: str, version: str | None = None) -> bool:
"""Check if a module can be imported.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
Dependency of distutils was dropped because the package will be
removed with Python 3.12.
"""
@@ -170,7 +170,7 @@
Foo.bar gives 'baz'.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def __init__(self, cls_method) -> None:
@@ -206,7 +206,7 @@
Those suppressed warnings that do not match the parameters will be
raised shown upon exit.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def __init__(
@@ -271,7 +271,7 @@
"""Mixin class to allow comparing to other objects which are comparable.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
@abc.abstractmethod
@@ -280,7 +280,7 @@
This ensures that ``_cmpkey`` method is defined in subclass.
- .. versionadded:: 8.1.2
+ .. version-added:: 8.1.2
"""
def __lt__(self, other):
@@ -318,7 +318,7 @@
>>> first_lower('Hello World')
'hello World'
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
return string[:1].lower() + string[1:]
@@ -333,7 +333,7 @@
>>> first_upper('hello World')
'Hello World'
- .. versionadded:: 3.0
+ .. version-added:: 3.0
.. note:: MediaWiki doesn't capitalize some characters the same way
as Python. This function tries to be close to MediaWiki's
capitalize function in title.php. See :phab:`T179115` and
@@ -372,7 +372,7 @@
...
ValueError: Invalid repl parameter '?'
- .. versionadded:: 8.0
+ .. version-added:: 8.0
:param string: the string to be modified
:param repl: the replacement character
@@ -401,7 +401,7 @@
...
ValueError: invalid truth value 'aye'
- .. versionadded:: 7.1
+ .. version-added:: 7.1
:param val: True values are 'y', 'yes', 't', 'true', 'on', and '1';
false values are 'n', 'no', 'f', 'false', 'off', and '0'.
@@ -418,7 +418,7 @@
def normalize_username(username) -> str | None:
"""Normalize the username.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
if not username:
return None
@@ -447,9 +447,9 @@
Any other suffixes are considered invalid.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
- .. versionchanged:: 6.1
+ .. version-changed:: 6.1
Dependency of distutils was dropped because the package will be
removed with Python 3.12.
"""
@@ -516,7 +516,7 @@
def __repr__(self) -> str:
"""Return version number representation, mainly used by tests.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
"""
return f"'{self}'"
@@ -553,7 +553,7 @@
The compression is either selected via the magic number or file
ending.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
:param filename: The filename.
:param use_extension: Use the file extension instead of the magic
@@ -652,7 +652,7 @@
also possible to define an additional dict using the keyword
arguments.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
args = [*list(args), dict(kwargs)]
conflicts = set()
@@ -675,7 +675,7 @@
) -> None:
"""Check file mode and update it, if needed.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
:param filename: filename path
:param mode: requested file mode
@@ -707,8 +707,8 @@
Result is expressed as hexdigest().
- .. versionadded:: 3.0
- .. versionchanged:: 8.2
+ .. version-added:: 3.0
+ .. version-changed:: 8.2
*sha* may be also a hash constructor, or a callable that returns
a hash object.
@@ -766,7 +766,7 @@
.. note:: A property must be decorated on top of the property method
below other decorators. This decorator must not be used with
functions.
- .. versionadded:: 7.3
+ .. version-added:: 7.3
:raises TypeError: decorator must be used without arguments
"""
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index f67f91d..50e7d0c 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -15,7 +15,7 @@
only one arg, and that arg be a callable, as it will be detected as
a deprecator without any arguments.
-.. versionchanged:: 6.4
+.. version-changed:: 6.4
deprecation decorators moved to _deprecate submodule
"""
#
@@ -53,7 +53,7 @@
"""Feature that is no longer implemented.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
@@ -83,7 +83,7 @@
def manage_wrapping(wrapper, obj) -> None:
"""Add attributes to wrapper and wrapped functions.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
wrapper.__doc__ = obj.__doc__
wrapper.__name__ = obj.__name__
@@ -111,7 +111,7 @@
def get_wrapper_depth(wrapper):
"""Return depth of wrapper function.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
return wrapper.__wrapped__.__wrappers__ + (1 - wrapper.__depth__)
@@ -178,9 +178,9 @@
def _build_msg_string(instead: str | None, since: str | None) -> str:
"""Build a deprecation warning message format string.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
`since`parameter must be a release number, not a timestamp.
:param instead: suggested replacement for the deprecated object
@@ -203,10 +203,10 @@
since: str | None = None) -> None:
"""Issue a deprecation warning.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
*since* parameter must be a release number, not a timestamp.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*warning_class* and *since* are keyword-only parameters.
:param name: the name of the deprecated object
@@ -226,7 +226,7 @@
def deprecated(*args, **kwargs):
"""Decorator to output a deprecation warning.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
`since` keyword must be a release number, not a timestamp.
:keyword str instead: if provided, will be used to specify the
@@ -339,7 +339,7 @@
reserved words even for future Python releases and to prevent syntax
errors.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
bool type of *new_arg* is no longer supported.
:param old_arg: old keyword
@@ -359,12 +359,12 @@
def my_function(bar='baz'): pass
# replaces 'foo' keyword by 'bar' and ignores 'baz' keyword
- .. versionchanged:: 3.0.20200703
+ .. version-changed:: 3.0.20200703
show a FutureWarning if the *arg_pairs* value is True; don't show
a warning if the value is an empty string.
- .. versionchanged:: 6.4
+ .. version-changed:: 6.4
show a FutureWarning for renamed arguments
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
bool type argument is no longer supported.
:param arg_pairs: Each entry points to the new argument name. If an
@@ -497,10 +497,10 @@
keyword-only arguments must match the order of the old positional
parameters; otherwise, argument assignment may fail.
- .. versionadded:: 9.2
- .. versionchanged:: 10.4
+ .. version-added:: 9.2
+ .. version-changed:: 10.4
Raises ``ValueError`` if method has a ``*args`` parameter.
- .. versionchanged:: 10.6
+ .. version-changed:: 10.6
Renamed from ``deprecate_positionals``. Adds handling of
positional-only parameters and emits warnings if they are passed
as keyword arguments.
@@ -697,10 +697,10 @@
It also acts like marking that function deprecated and copies all
parameters.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
*since* parameter must be a release number, not a timestamp.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
All parameters except *target* are keyword-only parameters.
:param target: The targeted function which is to be executed.
@@ -777,7 +777,7 @@
future_warning: bool = True) -> None:
"""Add the name to the local deprecated names dict.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
``since`` parameter must be a release number, not a timestamp.
:param name: The name of the deprecated class or variable. It may not
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index c4a9d87..ce1551b 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -98,7 +98,7 @@
For a single *encodings* string this function is equivalent to
:samp:`urllib.parse.unquote(title, encodings, errors='strict')`
- .. versionchanged:: 8.4
+ .. version-changed:: 8.4
Ignore *LookupError* and try other encodings.
.. seealso:: :python:`urllib.parse.unquote
diff --git a/pywikibot/tools/collections.py b/pywikibot/tools/collections.py
index 4ea3d87..3b14ca2 100644
--- a/pywikibot/tools/collections.py
+++ b/pywikibot/tools/collections.py
@@ -63,7 +63,7 @@
>>> list(data)
[]
- .. versionadded:: 6.1
+ .. version-added:: 6.1
"""
def __init__(self, keyattr: str) -> None:
@@ -144,7 +144,7 @@
"""An error that gets caught by both KeyError and IndexError.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
@@ -159,8 +159,8 @@
Accessing a value via __getitem__ will result in a combined KeyError and
IndexError.
- .. versionadded:: 3.0
- .. versionchanged:: 6.2
+ .. version-added:: 3.0
+ .. version-changed:: 6.2
``empty_iterator()`` was removed in favour of ``iter()``.
"""
@@ -185,8 +185,8 @@
"""A generator that allows items to be added during generating.
- .. versionadded:: 3.0
- .. versionchanged:: 6.1
+ .. version-added:: 3.0
+ .. version-changed:: 6.1
Provide a representation string.
"""
@@ -212,7 +212,7 @@
<reference/expressions.html#generator.close>` mixin method and it can
be used as Iterable and Iterator as well.
- .. versionadded:: 7.6
+ .. version-added:: 7.6
Example:
@@ -290,10 +290,10 @@
<reference/expressions.html#generator.throw>` for various
parameter usage.
- .. versionchanged:: 10.7
+ .. version-changed:: 10.7
The *val* and *tb* parameters were renamed to *value* and
*traceback*.
- .. deprecated:: 10.7
+ .. version-deprecated:: 10.7
The ``(type, value, traceback)`` signature is deprecated; use
single-arg signature ``throw(value)`` instead.
@@ -364,7 +364,7 @@
>>> newlimit.ratio
inf
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
group: str = 'unknown'
diff --git a/pywikibot/tools/formatter.py b/pywikibot/tools/formatter.py
index d2e8fdc..ab7cbe7 100644
--- a/pywikibot/tools/formatter.py
+++ b/pywikibot/tools/formatter.py
@@ -1,6 +1,6 @@
"""Module containing various formatting related utilities."""
#
-# (C) Pywikibot team, 2015-2024
+# (C) Pywikibot team, 2015-2025
#
# Distributed under the terms of the MIT license.
#
@@ -57,7 +57,7 @@
def output(self) -> None:
"""Output the text of the current sequence.
- .. deprecated:: 9.0
+ .. version-deprecated:: 9.0
Use :func:`pywikibot.info()<pywikibot.logging.info>` with
:attr:`out` property.
"""
diff --git a/pywikibot/tools/itertools.py b/pywikibot/tools/itertools.py
index 7937989..867a98b 100644
--- a/pywikibot/tools/itertools.py
+++ b/pywikibot/tools/itertools.py
@@ -77,7 +77,7 @@
>>> list(union_generators([4, 3, 2, 1], [5, 4, 3], [6, 2], reverse=True))
[6, 5, 4, 3, 2, 1]
- .. versionadded:: 10.6
+ .. version-added:: 10.6
.. note::
All input iterables must be sorted consistently. *reverse* must
@@ -116,19 +116,19 @@
['m', 'i', 's', 's', 'i']
- .. versionadded:: 3.0
+ .. version-added:: 3.0
- .. versionchanged:: 5.0
+ .. version-changed:: 5.0
Avoid duplicates (:phab:`T263947`).
- .. versionchanged:: 6.4
+ .. version-changed:: 6.4
``genlist`` was renamed to ``iterables``; consecutive iterables
are to be used as iterables parameters or '*' to unpack a list
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
Reimplemented without threads which is up to 10'000 times faster
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Iterable elements may consist of lists or tuples
``allow_duplicates`` is a keyword-only argument
@@ -205,8 +205,8 @@
>>> tuple(roundrobin_generators('ABC', range(5)))
('A', 0, 'B', 1, 'C', 2, 3, 4)
- .. versionadded:: 3.0
- .. versionchanged:: 6.4
+ .. version-added:: 3.0
+ .. version-changed:: 6.4
A sentinel variable is used to determine the end of an iterable
instead of None.
@@ -248,7 +248,7 @@
.. warning:: This is not thread safe.
- .. versionadded:: 3.0
+ .. version-added:: 3.0
:param iterable: the source iterable
:type iterable: collections.abc.Iterable
diff --git a/pywikibot/tools/threading.py b/pywikibot/tools/threading.py
index 83c40de..8c94f6e 100644
--- a/pywikibot/tools/threading.py
+++ b/pywikibot/tools/threading.py
@@ -47,7 +47,7 @@
>>> data
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
- .. versionadded:: 3.0
+ .. version-added:: 3.0
"""
def __init__(self, group=None, target=None, name: str = 'GeneratorThread',
@@ -135,7 +135,7 @@
for x in range(20):
pool.append(threading.Thread(target=work))
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
the unintentional and undocumented *args* parameter was removed.
.. seealso:: :class:`BoundedPoolExecutor`
@@ -183,7 +183,7 @@
block further items on :meth:`submit` calls to be added to workers
queue if the *max_bound* limit is reached.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
.. seealso::
- :pylib:`concurrent.futures.html#executor-objects`
diff --git a/pywikibot/userinterfaces/_interface_base.py b/pywikibot/userinterfaces/_interface_base.py
index d754eeb..1e2b776 100644
--- a/pywikibot/userinterfaces/_interface_base.py
+++ b/pywikibot/userinterfaces/_interface_base.py
@@ -1,9 +1,9 @@
"""Abstract base user interface module.
-.. versionadded:: 6.2
+.. version-added:: 6.2
"""
#
-# (C) Pywikibot team, 2021
+# (C) Pywikibot team, 2021-2025
#
# Distributed under the terms of the MIT license.
#
@@ -21,7 +21,7 @@
Every user interface should derive from it to ensure that all
required methods are implemented.
- .. versionadded:: 6.2
+ .. version-added:: 6.2
"""
def argvu(self) -> list[str]:
diff --git a/pywikibot/userinterfaces/buffer_interface.py b/pywikibot/userinterfaces/buffer_interface.py
index 3fba15c..864f4ff 100644
--- a/pywikibot/userinterfaces/buffer_interface.py
+++ b/pywikibot/userinterfaces/buffer_interface.py
@@ -1,6 +1,6 @@
"""Non-interactive interface that stores output.
-.. versionadded:: 6.4
+.. version-added:: 6.4
"""
#
# (C) Pywikibot team, 2021-2025
@@ -23,7 +23,7 @@
"""Collects output into an unseen buffer.
- .. versionadded:: 6.4
+ .. version-added:: 6.4
"""
def __init__(self) -> None:
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index 00509da..ce3e8b9 100644
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -60,7 +60,7 @@
"""Base for terminal user interfaces.
- .. versionchanged:: 6.2:
+ .. version-changed:: 6.2:
subclassed from
:py:obj:`userinterfaces._interface_base.ABUIC`
"""
@@ -73,7 +73,7 @@
This caches the std-streams locally so any attempts to
monkey-patch the streams later will not work.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
memorize original streams
"""
# for Windows GUI they can be None under some conditions
@@ -164,7 +164,7 @@
against the frozen streams, and then write to the (potentially
redirected) `sys.stderr` or `sys.stdout` stream.
- .. versionchanged:: 7.1
+ .. version-changed:: 7.1
instead of writing to `target_stream`, dispatch to
`sys.stderr` or `sys.stdout`.
"""
@@ -242,7 +242,7 @@
in cache. They will be printed with next unlocked output call or
at termination time.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
Forward text to cache and flush if output is not locked.
"""
self.cache_output(text, targetStream=targetStream)
@@ -252,7 +252,7 @@
def flush(self) -> None:
"""Output cached text.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
with self.lock:
for args, kwargs in self.cache:
@@ -262,7 +262,7 @@
def cache_output(self, *args, **kwargs) -> None:
"""Put text to cache.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
with self.lock:
self.cache.append((args, kwargs))
@@ -274,7 +274,7 @@
terminal, it will be replaced with a question mark or by a
transliteration.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
``UI.output()`` was renamed to ``UI.stream_output()``
"""
if config.transliterate:
@@ -418,7 +418,7 @@
not be sensible when the option supports multiple values as
it'll return an ambiguous index.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
Raise ValueError if no *default* value is given with *force*;
raise ValueError if *force* is True and *default* value is
invalid; raise TypeError if *default* value is neither str
diff --git a/pywikibot/userinterfaces/transliteration.py b/pywikibot/userinterfaces/transliteration.py
index 94179b4..869c279 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -1132,9 +1132,9 @@
prev: str = '-', succ: str = '-') -> str:
"""Transliterate the character.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
*next* parameter was renamed to *succ*.
- .. versionchanged:: 10.6
+ .. version-changed:: 10.6
*char* argument is positional only; *prev* and *succ*
arguments are keyword only.
diff --git a/pywikibot/version.py b/pywikibot/version.py
index bc93788..6dab2cf 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -36,8 +36,8 @@
def get_toolforge_hostname() -> str | None:
"""Get hostname of the current Toolforge host.
- .. versionadded:: 3.0
- .. deprecated:: 9.0
+ .. version-added:: 3.0
+ .. version-deprecated:: 9.0
:return: The hostname of the currently running host,
if it is in Wikimedia Toolforge; otherwise return None.
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py
index e201b72..bb37ccf 100644
--- a/pywikibot/xmlreader.py
+++ b/pywikibot/xmlreader.py
@@ -6,7 +6,7 @@
https://dumps.wikimedia.org/backup-index.html) and offers a generator over
XmlEntry objects which can be used by other bots.
-.. versionchanged:: 7.7
+.. version-changed:: 7.7
*defusedxml* is used in favour of *xml.etree* if present to prevent
vulnerable XML attacks. *defusedxml* 0.7.1 or higher is recommended.
"""
@@ -61,7 +61,7 @@
"""Represent the common info of a page.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
title: str
@@ -76,7 +76,7 @@
"""Represent a raw revision.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
headers: Headers
@@ -91,11 +91,11 @@
Reads the local file at initialization,
parses it, and offers access to the resulting XmlEntries via a generator.
- .. versionadded:: 7.2
+ .. version-added:: 7.2
the `on_error` parameter
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`allrevisions` parameter must be given as keyword parameter
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
`allrevisions` parameter is deprecated due to :phab:`T340804`,
`revisions` parameter was introduced as replacement.
`root` attribute was removed.
@@ -173,7 +173,7 @@
def parse(self) -> Iterator[XmlEntry]:
"""Generator using ElementTree iterparse function.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
if a ParseError occurs it can be handled by the callable
given with `on_error` parameter of this instance.
"""
@@ -212,7 +212,7 @@
def _parse_only_first_found(self, elem: Element) -> Iterator[XmlEntry]:
"""Parser that yields the first revision found.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
raw_revs = self._fetch_revs(elem)
try:
@@ -231,7 +231,7 @@
def _parse_only_earliest(self, elem: Element) -> Iterator[XmlEntry]:
"""Parser that yields only the earliest revision.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
raw_revs = self._fetch_revs(elem, with_id=True)
raw_rev = min(raw_revs, default=None, key=lambda rev: rev.revid)
@@ -247,7 +247,7 @@
def _fetch_revs(self, elem: Element, with_id=False) -> Iterator[RawRev]:
"""Yield all revisions in a page.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
uri = self.uri
headers = self._headers(elem)
@@ -262,7 +262,7 @@
Returns strings representing user groups allowed to edit and
to move a page, where None means there are no restrictions.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
replaces deprecated ``parseRestrictions`` function.
"""
if not restrictions:
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 369d5cc..c0a2f7a 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -168,23 +168,23 @@
Version historty:
-.. versionchanged:: 7.6
+.. version-changed:: 7.6
Localized variables for the ``archive`` parameter are supported.
``User:MiszaBot/config`` is the default template. The ``-keep`` option
was added.
-.. versionchanged:: 7.7
+.. version-changed:: 7.7
``-sort`` and ``-async`` options were added.
-.. versionchanged:: 8.2
+.. version-changed:: 8.2
KeyboardInterrupt support added when using the ``-async`` option.
-.. versionchanged:: 10.3
+.. version-changed:: 10.3
If ``archiveheader`` is not set, the bot now attempts to retrieve a
localized template from Wikidata (based on known item IDs). If none is
found, ``{{talkarchive}}`` is used as fallback.
-.. versionchanged:: 11.0
+.. version-changed:: 11.0
The ``-namespace`` option is now respected by ``-page`` option.
"""
#
@@ -410,7 +410,7 @@
def __getattr__(self, name):
"""Lazy load page if archives, header or threads attribute is missing.
- .. versionadded:: 8.1
+ .. version-added:: 8.1
"""
if name in ('archives', 'header', 'threads'):
self.load_page()
@@ -423,7 +423,7 @@
) -> pywikibot.Timestamp | None:
"""Calculate the maximum of two timestamps but allow None as value.
- .. versionadded:: 7.6
+ .. version-added:: 7.6
"""
if ts1 is None:
return ts2
@@ -443,9 +443,9 @@
If no such localized template is found, it falls back to the
default ``{{talkarchive}}`` template.
- .. versionadded:: 10.2
+ .. version-added:: 10.2
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
Returns ``{{talkarchive}}`` by default if no localized
template is found.
@@ -464,10 +464,10 @@
def load_page(self) -> None:
"""Load the page to be archived and break it up into threads.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
If `-keep` option is given run through all threads and set
the current timestamp to the previous if the current is lower.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
Load unsigned threads using timestamp of the next thread.
"""
self.header = ''
@@ -547,7 +547,7 @@
(characters). This corresponds to MediaWiki's definition
of page size.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
return 0 if archive page neither exists nor has threads
(:phab:`T313886`).
"""
@@ -563,7 +563,7 @@
asynchronous: bool = False) -> None:
"""Recombine threads and save page.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
the *asynchronous* parameter was added.
"""
if sort_threads:
@@ -590,7 +590,7 @@
asynchronous: bool = False) -> None:
"""Initializer.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
The *asynchronous* parameter was added.
:param page: a page object to be archived
@@ -635,7 +635,7 @@
def info(self, msg: str = '') -> None:
"""Forward text to cache if asynchronous is activated.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
"""
if self.asynchronous:
self.output.append(msg)
@@ -645,7 +645,7 @@
def flush(self) -> None:
"""Flush the cache.
- .. versionadded:: 10.0
+ .. version-added:: 10.0
"""
pywikibot.info('\n'.join(self.output))
self.output.clear()
@@ -892,7 +892,7 @@
def run(self) -> None:
"""Process a single DiscussionPage object.
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
save the talk page in asynchronous mode if ``-async`` option
was given but archive pages are saved in synchronous mode.
"""
@@ -966,10 +966,10 @@
:return: Return True to continue with the next page, False to break
the loop.
- .. versionadded:: 7.6
- .. versionchanged:: 7.7
+ .. version-added:: 7.6
+ .. version-changed:: 7.7
pass an unspecified number of arguments to the bot using ``*args``
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
*asynchronous* parameter was added.
"""
global outlock
diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index 2348e46..c8581a6 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -185,7 +185,7 @@
"""Bot to remove stale protection templates from unprotected pages.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/category.py b/scripts/category.py
index 86be2c8..230e20c 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -149,7 +149,7 @@
The sample above would remove 'Hydraulics' category from all pages which
are also in 'Pneumatics' category.
-.. versionchanged:: 8.0
+.. version-changed:: 8.0
:mod:`pagegenerators` are supported with "move" and "remove" action.
"""
#
@@ -583,7 +583,7 @@
Per default the operation applies to pages and subcategories.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
The ``generator`` parameter.
"""
@@ -730,7 +730,7 @@
- _change()
- _delete()
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
if a page generator is given to the bot, the intersection
with :func:`pagegenerators.CategorizedPageGenerator` or
:func:`pagegenerators.SubCategoriesPageGenerator` is used.
@@ -1345,7 +1345,7 @@
robot = CategoryTreeRobot(
'Physics', db, 'physics_tree.txt', max_depth=5)
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
*max_depth* is keyword only.
:param cat_title: The category that serves as the root of the
@@ -1397,7 +1397,7 @@
given category *cat*, up to the depth specified by
``self.max_depth``. This method is recursive.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
*parent* is keyword only.
Example:
@@ -1482,7 +1482,7 @@
- :wiki:`WP:SUBCAT`
- :wiki:`WP:DIFFUSE`
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
update_options = {
diff --git a/scripts/category_graph.py b/scripts/category_graph.py
index 0a8f8ab..657e37f 100755
--- a/scripts/category_graph.py
+++ b/scripts/category_graph.py
@@ -40,7 +40,7 @@
fillcolor=green] edge[style=dashed penwidth=3]'
-.. versionadded:: 8.0
+.. version-added:: 8.0
"""
#
# (C) Pywikibot team, 2022-2025
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index fc4e0cc..b02088f 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -35,7 +35,7 @@
can be set within a settings file which is scripts.ini by default.
"""
#
-# (C) Pywikibot team, 2008-2023
+# (C) Pywikibot team, 2008-2025
#
# Distributed under the terms of the MIT license.
#
@@ -79,10 +79,10 @@
"""Page category update bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CategoryRedirectBot is a ConfigParserBot
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
A logentry is written to <userpage>/category_edit_requests if a
page cannot be moved
"""
diff --git a/scripts/change_pagelang.py b/scripts/change_pagelang.py
index bedd622..d9ef29e 100755
--- a/scripts/change_pagelang.py
+++ b/scripts/change_pagelang.py
@@ -20,7 +20,7 @@
.. note:: This script is a
:class:`ConfigParserBot<bot.ConfigParserBot>`. All options can be set
within a settings file which is scripts.ini by default.
-.. versionadded:: 5.1
+.. version-added:: 5.1
"""
#
# (C) Pywikibot team, 2018-2025
@@ -43,7 +43,7 @@
"""Change page language bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
ChangeLangBot is a ConfigParserBot
"""
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index e578550..a1a8c56 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -71,7 +71,7 @@
Text= This is the template that the bot will use when it will
report the image's problem.
-.. versionchanged:: 8.4
+.. version-changed:: 8.4
Welcome messages are imported from :mod:`scripts.welcome` script.
"""
#
@@ -410,7 +410,7 @@
CATEGORIES_WITH_LICENSES = 'Q4481876', 'Q7451504'
"""Category items with the licenses; subcategories may contain other licenses.
-.. versionchanged:: 7.2
+.. version-changed:: 7.2
uses wikibase items instead of category titles.
"""
@@ -782,7 +782,7 @@
) -> pywikibot.FilePage:
"""Get tuples of image and time, return the most used or oldest image.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
itertools.zip_longest is used to stop `using_pages` as soon as
possible.
@@ -1105,7 +1105,7 @@
def load_licenses(self) -> set[pywikibot.Page]:
"""Load the list of the licenses.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
return a set instead of a list for quicker lookup.
"""
pywikibot.info('\nLoading the allowed licenses...\n')
diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index 67bdca9..233b653 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -53,13 +53,13 @@
python pwb.py commons_information -start:File:!
-.. versionadded:: 6.0
-.. versionchanged:: 9.2
+.. version-added:: 6.0
+.. version-changed:: 9.2
accelerate script with preloading pages; use ``commons`` as default
site; use transcluded pages of ``Information`` template.
"""
#
-# (C) Pywikibot team, 2015-2024
+# (C) Pywikibot team, 2015-2025
#
# Distributed under the terms of the MIT license.
#
@@ -190,7 +190,7 @@
Combine all nodes and replace the last with new created
Template while removing the remaining from *wikicode*.
- .. versionadded:: 9.2
+ .. version-added:: 9.2
:param wikicode: The Wikicode of the parsed page text.
:param nodes: wikitext nodes to be processed
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index b89ab6b..3a5ab19 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -240,7 +240,7 @@
"""Commons categorisation bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CommonscatBot is a ConfigParserBot
"""
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index aaba65d..1f1eb7e 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -42,7 +42,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2013-2024
+# (C) Pywikibot team, 2013-2025
#
# Distributed under the terms of MIT license.
#
@@ -61,7 +61,7 @@
"""A bot to import coordinates to Wikidata.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CoordImportRobot is a ConfigParserBot
"""
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 346d721..e314e77 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -31,7 +31,7 @@
For further information see pywikibot/cosmetic_changes.py
"""
#
-# (C) Pywikibot team, 2006-2022
+# (C) Pywikibot team, 2006-2025
#
# Distributed under the terms of the MIT license.
#
@@ -71,7 +71,7 @@
def treat_page(self) -> None:
"""Treat page with the cosmetic toolkit.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
skip if InvalidPageError is raised
"""
cc_toolkit = CosmeticChangesToolkit(self.current_page,
diff --git a/scripts/delinker.py b/scripts/delinker.py
index 9357bee..4645151 100755
--- a/scripts/delinker.py
+++ b/scripts/delinker.py
@@ -30,9 +30,9 @@
don't want the default values you can add any option you want to
change to that settings file below the [delinker] section like.
-.. versionadded:: 7.2
+.. version-added:: 7.2
This script is completely rewritten from compat branch.
-.. versionchanged:: 9.4
+.. version-changed:: 9.4
*-category* option was added.
"""
#
diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index 845520e..c09070d 100755
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -57,7 +57,7 @@
Works only on sites with Proofread Page extension installed.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/download_dump.py b/scripts/download_dump.py
index 6436b93..f79f7d3 100755
--- a/scripts/download_dump.py
+++ b/scripts/download_dump.py
@@ -13,10 +13,10 @@
.. note:: This script is a
:class:`ConfigParserBot<bot.ConfigParserBot>`. All options can be set
within a settings file which is scripts.ini by default.
-.. versionadded:: 3.0.20180108
+.. version-added:: 3.0.20180108
"""
#
-# (C) Pywikibot team, 2017-2024
+# (C) Pywikibot team, 2017-2025
#
# Distributed under the terms of the MIT license.
#
@@ -36,7 +36,7 @@
"""Download dump bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
DownloadDumpBot is a ConfigParserBot
"""
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 9ac823e..02bf72f 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -105,7 +105,7 @@
.. note:: This script is a
:py:obj:`ConfigParserBot <bot.ConfigParserBot>`. All options
can be set within a settings file which is scripts.ini by default.
-.. versionadded:: 7.5
+.. version-added:: 7.5
the -inverse option.
"""
#
@@ -168,7 +168,7 @@
"""A bot to add Wikidata claims.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
HarvestRobot is a ConfigParserBot
"""
@@ -242,7 +242,7 @@
link_text: str) -> pywikibot.ItemPage | None:
"""Find the ItemPage target for a given link text.
- .. versionchanged:: 7.5
+ .. version-changed:: 7.5
Only follow the redirect target if redirect page has no
wikibase item.
"""
@@ -323,7 +323,7 @@
field_item: tuple[str, str]) -> None:
"""Process a single field of template fielddict.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
field, value = field_item
field = field.strip()
@@ -387,7 +387,7 @@
) -> Generator[pywikibot.ItemPage]:
"""Handle 'wikibase-item' claim type.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
value = value.replace('{{!}}', '|')
prop, options = self.fields[field]
@@ -418,7 +418,7 @@
*args) -> Generator[WbTime]:
"""Handle 'time' claim type.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
value = value.replace('{{!}}', '|')
value = value.replace(' ', ' ')
@@ -472,7 +472,7 @@
def handle_string(value: str, *args) -> Generator[str]:
"""Handle 'string' and 'external-id' claim type.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
yield value.strip()
@@ -481,7 +481,7 @@
def handle_url(self, value, *args) -> Generator[str]:
"""Handle 'url' claim type.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
for match in self.linkR.finditer(value):
yield match['url']
@@ -494,7 +494,7 @@
) -> Generator[pywikibot.FilePage]:
"""Handle 'commonsMedia' claim type.
- .. versionadded:: 7.5
+ .. version-added:: 7.5
"""
repo = site.image_repository()
image = pywikibot.FilePage(repo, value)
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 200a083..1ea8116 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -342,7 +342,7 @@
``-start:!``, and if it takes so long that you have to break it off, use
``-continue`` next time.
-.. versionchanged:: 10.4
+.. version-changed:: 10.4
The ``-localonly`` option now restricts page processing to the
default site only, instead of the origin page.
"""
@@ -683,7 +683,7 @@
def is_not_redirect(page):
"""Check whether *page* is not a redirect page.
- .. versionadded:: 11.0
+ .. version-added:: 11.0
"""
return page.exists() and not (page.isRedirectPage()
or page.isCategoryRedirect())
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index 97da3df..abd1f7a 100755
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -30,7 +30,7 @@
default.
"""
-# (C) Pywikibot team, 2015-2024
+# (C) Pywikibot team, 2015-2025
#
# Distributed under the terms of the MIT license.
#
@@ -59,7 +59,7 @@
"""The bot for interwiki.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
IWBot is a ConfigParserBot
"""
diff --git a/scripts/maintenance/__init__.py b/scripts/maintenance/__init__.py
index f6932d9..d51bb79 100644
--- a/scripts/maintenance/__init__.py
+++ b/scripts/maintenance/__init__.py
@@ -1,15 +1,15 @@
"""Maintenance scripts.
-.. versionremoved:: 3.0.20190430
+.. version-removed:: 3.0.20190430
``diff_checker`` script was removed (:phab:`T221462`).
-.. versionremoved:: 6.1
+.. version-removed:: 6.1
``compat2core`` script was removed.
-.. versionremoved:: 7.3
+.. version-removed:: 7.3
``update_linktrails`` script (:phab:`T89451`) and ``update_script``
script were removed.
-.. versionremoved:: 8.0
+.. version-removed:: 8.0
``sorting_order`` script was removed (:phab:`T325426`).
-.. versionremoved:: 9.0
+.. version-removed:: 9.0
``wikimedia_sites`` script was removed (:phab:`T78396`).
"""
from __future__ import annotations
diff --git a/scripts/maintenance/addwikis.py b/scripts/maintenance/addwikis.py
index 501b8f7..86e2606 100755
--- a/scripts/maintenance/addwikis.py
+++ b/scripts/maintenance/addwikis.py
@@ -14,12 +14,12 @@
and ``baz`` to wikisource.
-.. versionadded:: 9.2
-.. versionchanged:: 10.4
+.. version-added:: 9.2
+.. version-changed:: 10.4
The options ``-h``, ``-help`` and ``--help`` display the help message.
-.. deprecated:: 10.4
+.. version-deprecated:: 10.4
The ``help`` option
-.. versionchanged:: 11.0
+.. version-changed:: 11.0
Multiple families can be given with one run.
"""
#
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 9cc42af..fbb2d97 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -63,7 +63,7 @@
uniquedesc(entry)
"""
#
-# (C) Pywikibot team, 2014-2024
+# (C) Pywikibot team, 2014-2025
#
# Distributed under the terms of the MIT license.
#
@@ -116,7 +116,7 @@
def _get_cache_dir(self) -> Path:
"""Directory of the cached entry.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
return a `pathlib.Path` object.
"""
return Path(self.directory)
@@ -124,7 +124,7 @@
def _cachefile_path(self) -> Path:
"""Return cache file path.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
return a `pathlib.Path` object.
"""
return self._get_cache_dir() / self._create_file_name()
@@ -229,7 +229,7 @@
check the filesystem mount options. You may need to remount with
'strictatime'.
- .. versionchanged:: 9.0
+ .. version-changed:: 9.0
default cache path to 'apicache' without Python main version.
:param use_accesstime: Whether access times should be used. `None`
diff --git a/scripts/maintenance/unidata.py b/scripts/maintenance/unidata.py
index 096a600..1adee27 100755
--- a/scripts/maintenance/unidata.py
+++ b/scripts/maintenance/unidata.py
@@ -7,10 +7,10 @@
a superse of the older version and should be enough. But this is not
tested completely.
-.. versionadded:: 8.4
+.. version-added:: 8.4
"""
#
-# (C) Pywikibot team, 2018-2024
+# (C) Pywikibot team, 2018-2025
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/movepages.py b/scripts/movepages.py
index 0850b4f..5d2b50a 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -36,7 +36,7 @@
``-pairsfile:filename``
"""
#
-# (C) Pywikibot team, 2006-2024
+# (C) Pywikibot team, 2006-2025
#
# Distributed under the terms of the MIT license.
#
@@ -61,7 +61,7 @@
"""Page move bot.
- .. versionchanged:: 7.2
+ .. version-changed:: 7.2
`movesubpages` option was added
"""
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index 33d6fc0..5733e3e 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -763,7 +763,7 @@
ident: str = '==') -> str:
"""Create a reference section and insert it into the given text.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
raise :exc:`exceptions.TranslationError` if script is not
localized for the current site.
@@ -802,7 +802,7 @@
def treat_page(self) -> None:
"""Run the bot.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
print error message and close :attr:`bot.BaseBot.generator`
if :exc:`exceptions.TranslationError` was raised.
"""
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index cab5ff4..c97a5ab 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -42,7 +42,7 @@
can be set within a settings file which is scripts.ini by default.
"""
#
-# (C) Pywikibot team, 2006-2024
+# (C) Pywikibot team, 2006-2025
#
# Distributed under the terms of the MIT license.
#
@@ -187,7 +187,7 @@
"""Bot to delete migrated files.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
NowCommonsDeleteBot is a ConfigParserBot
"""
diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 5f31b5c..4ef6844 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -99,7 +99,7 @@
def __init__(self, offset: int, source: str | None = None) -> None:
"""Initializer.
- .. versionchanged:: 10.7
+ .. version-changed:: 10.7
*source* was added; a message was passed to Exception super
class.
"""
@@ -190,7 +190,7 @@
"""Generator class, responsible for reading the file.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
subclassed from :class:`pywikibot.tools.collections.GeneratorWrapper`
"""
@@ -236,7 +236,7 @@
content is stored as a page attribute defined by CTX_ATTR.
- .. versionchanged:: 7.6
+ .. version-changed:: 7.6
changed from iterator method to generator property
"""
pywikibot.info(f"\n\nReading '{self.filename}'...")
diff --git a/scripts/protect.py b/scripts/protect.py
index b462e7a..79a1236 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -76,7 +76,7 @@
"""This bot allows protection of pages en masse.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
CheckerBot is a ConfigParserBot
"""
diff --git a/scripts/redirect.py b/scripts/redirect.py
index f03d81b..3b69e46 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -21,7 +21,7 @@
deletion if there is no speedy deletion template
available.
- .. versionchanged:: 10.3
+ .. version-changed:: 10.3
only tries to fix if the namspace of the source page
is equal to the destination page.
@@ -238,7 +238,7 @@
) -> Generator[tuple[str, int | None, str, str | None]]:
r"""Return a generator that yields tuples of data about redirect Pages.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
only yield tuple if type of redirect is not 1 (normal redirect)
The description of returned tuple items is as follows:
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 24edb1c..294d07b 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -424,7 +424,7 @@
"""References bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
ReferencesRobot is a ConfigParserBot
"""
diff --git a/scripts/replace.py b/scripts/replace.py
index cf32404..0b5ccfd 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -694,7 +694,7 @@
def treat(self, page) -> None:
"""Work on each page retrieved from generator.
- .. versionchanged:: 10.1
+ .. version-changed:: 10.1
After the browser call, the script affects the possibly
changed text.
"""
@@ -813,14 +813,14 @@
}
"""Dictionary to convert exceptions command line options to exceptions keys.
-.. versionadded:: 7.0
+.. version-added:: 7.0
"""
def handle_exceptions(*args: str) -> tuple[list[str], dict[str, str]]:
"""Handle exceptions args to ignore pages which contain certain texts.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
exceptions = {key: [] for key in EXC_KEYS.values()}
local_args = []
@@ -836,8 +836,8 @@
def handle_pairsfile(filename: str) -> list[str] | None:
"""Handle -pairsfile argument.
- .. versionadded:: 7.0
- .. versionchanged:: 9.2
+ .. version-added:: 7.0
+ .. version-changed:: 9.2
replacement patterns are printed it they are incomplete.
"""
if not filename:
@@ -865,7 +865,7 @@
def handle_manual() -> list[str]:
"""Handle manual input.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
pairs = []
old = pywikibot.input('Please enter the text that should be replaced:')
@@ -883,7 +883,7 @@
exceptions: list[re.Pattern]) -> Generator:
"""Handle default sql query.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
if not sql:
where_clause = 'WHERE ({})'.format(' OR '.join(
@@ -915,7 +915,7 @@
If args is an empty list, sys.argv is used.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
replacement patterns are printed it they are incomplete.
:param args: command line arguments
diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index d0c0f90..69a3a4c 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -101,7 +101,7 @@
def local_timestamp(self, ts) -> str:
"""Convert Timestamp to a localized timestamp string.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
"""
year = formatYear(self.site.lang, ts.year)
date = format_date(ts.month, ts.day, self.site)
diff --git a/scripts/touch.py b/scripts/touch.py
index b751a6d..2e18424 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -23,7 +23,7 @@
¶ms;
"""
#
-# (C) Pywikibot team, 2009-2024
+# (C) Pywikibot team, 2009-2025
#
# Distributed under the terms of the MIT license.
#
@@ -88,7 +88,7 @@
def treat(self, page) -> None:
"""Purge the given page.
- .. versionchanged:: 8.0
+ .. version-changed:: 8.0
Enable batch purge using :meth:`APISite.purgepages()
<pywikibot.site._apisite.APISite.purgepages>`
"""
@@ -100,7 +100,7 @@
def teardown(self) -> None:
"""Purge remaining pages if no KeyboardInterrupt was made.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
"""
if self.generator_completed:
with suppress(KeyboardInterrupt):
@@ -112,8 +112,8 @@
def purgepages(self, flush=False) -> None:
"""Purge a bulk of page if rate limit exceeded.
- .. versionadded:: 8.0
- .. versionchanged:: 9.0
+ .. version-added:: 8.0
+ .. version-changed:: 9.0
:meth:`site.APISite.ratelimit()
<pywikibot.site._apisite.APISite.ratelimit>` method is used
to determine bulk length and delay.
diff --git a/scripts/tracking_param_remover.py b/scripts/tracking_param_remover.py
index 623f1cd..acdc13a 100755
--- a/scripts/tracking_param_remover.py
+++ b/scripts/tracking_param_remover.py
@@ -10,7 +10,7 @@
-always Don't prompt for each removal
-.. versionadded:: 10.3
+.. version-added:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/scripts/transwikiimport.py b/scripts/transwikiimport.py
index d3932ef..32a6927 100755
--- a/scripts/transwikiimport.py
+++ b/scripts/transwikiimport.py
@@ -135,10 +135,10 @@
page the appropriate flag on the account must be set, usually
administrator, transwiki importer or importer.
-.. versionadded:: 8.2
+.. version-added:: 8.2
"""
#
-# (C) Pywikibot team, 2023-2024
+# (C) Pywikibot team, 2023-2025
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/unlink.py b/scripts/unlink.py
index 47d0a88..904942b 100755
--- a/scripts/unlink.py
+++ b/scripts/unlink.py
@@ -20,15 +20,15 @@
python pwb.py unlink "Foo bar" -namespace:0 -namespace:6
-.. versionchanged:: 6.0
+.. version-changed:: 6.0
script was archived.
-.. versionchanged:: 7.0
+.. version-changed:: 7.0
script was deleted.
-.. versionchanged:: 9.4
+.. version-changed:: 9.4
script was recovered.
"""
#
-# (C) Pywikibot team, 2007-2024
+# (C) Pywikibot team, 2007-2025
#
# Distributed under the terms of the MIT license.
#
diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index d9309c0..a071a10 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -20,7 +20,7 @@
-usertemplate: [str] Use a custom template to warn the uploader.
"""
#
-# (C) Pywikibot team, 2007-2024
+# (C) Pywikibot team, 2007-2025
#
# Distributed under the terms of the MIT license.
#
@@ -76,7 +76,7 @@
"""Unused files bot.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
UnusedFilesBot is a ConfigParserBot
"""
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index b2fb03f..5e6e8f4 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -21,7 +21,7 @@
-new Load watchlists for all wikis where accounts is set in user
config file
-.. versionchanged:: 7.7
+.. version-changed:: 7.7
watchlist is retrieved in parallel tasks.
"""
#
diff --git a/scripts/welcome.py b/scripts/welcome.py
index a39cab7..2941c71 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -790,7 +790,7 @@
def skip_page(self, user) -> bool:
"""Check whether the user is to be skipped.
- .. versionchanged:: 7.0
+ .. version-changed:: 7.0
also skip if user is locked globally
"""
if user.is_blocked() or user.is_locked():
diff --git a/setup.py b/setup.py
index 19acf97..51a6b39 100755
--- a/setup.py
+++ b/setup.py
@@ -96,7 +96,7 @@
``configparser`` is used. Therefore the tomlfile must be readable as
config file until the first comment.
- .. versionadded:: 9.0
+ .. version-added:: 9.0
"""
if sys.version_info >= (3, 11):
import tomllib
diff --git a/tests/README.rst b/tests/README.rst
index 503b397..60c7ea9 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -136,7 +136,7 @@
write operations successfully. These **will** write to the wikis, and they
should always only write to 'test' wikis.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
Enabling them will also enable 'edit failure' tests which attempt to write
to the wikis and **should** fail. If there is a bug in pywikibot or
MediaWiki, these tests **may** actually perform a write operation.
@@ -145,10 +145,10 @@
PYWIKIBOT_TEST_WRITE=1
-.. versionremoved:: 9.2
+.. version-removed:: 9.2
The :envvar:`PYWIKIBOT_TEST_WRITE_FAIL` environment variable; use
:envvar:`PYWIKIBOT_TEST_WRITE` instead.
-.. versionremoved:: 9.5
+.. version-removed:: 9.5
The :envvar:`PYWIKIBOT_TEST_GUI` environment variable.
Instead of setting the environment by the os (or `os.environ` as well) you can use the :mod:`pwb`
diff --git a/tests/aspects.py b/tests/aspects.py
index 6c8144e..c535aa9 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -73,7 +73,7 @@
The mixin will be removed without deprecation period once Python 3.14
becomes the minimum requirement for Pywikibot, likely with Pywikibot 16.
- .. versionadded:: 10.3
+ .. version-added:: 10.3
"""
def assertStartsWith(self, s: str, prefix: str,
@@ -292,7 +292,7 @@
) -> list[pywikibot.Page]:
"""Get pages from gen, asserting they are Page from site.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
the *count* parameter was dropped; all pages from *gen* are
tested.
@@ -339,7 +339,7 @@
skip: bool = False) -> None:
"""Try to confirm that generator returns Pages for all namespaces.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises TypeError instead of AssertionError
:param gen: generator to iterate
@@ -453,9 +453,9 @@
only supported for the current site — not for related sites like
data or image repositories.
- .. versionadded:: 8.0
+ .. version-added:: 8.0
- .. versionchanged:: 10.0
+ .. version-changed:: 10.0
TypeError and ValueError are used for validation fails.
*version_needed* parameter is positional only.
@@ -679,7 +679,7 @@
The test class is skipped unless environment variable
:envvar:`PYWIKIBOT_TEST_WRITE` is set to 1.
- .. versionchanged:: 9.2
+ .. version-changed:: 9.2
:envvar:`PYWIKIBOT_TEST_WRITE_FAIL` environment variable was
discarded, see :ref:`Environment variables`.
@@ -765,7 +765,7 @@
There may be many sites, and setUp doesn't know which site is to
be tested; ensure they are all logged in.
- .. versionadded:: 7.0
+ .. version-added:: 7.0
The `skip_if_login_fails` parameter.
:param skip_if_login_fails: called with setUp(); if True, skip
@@ -832,7 +832,7 @@
def __new__(cls, name, bases, dct):
"""Create the new class.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises AttributeError instead of AssertionError for
duplicated hostname, raises Exception instead of
AssertionError for missing or wrong "net" attribute with
@@ -1034,7 +1034,7 @@
def add_method(dct, test_name, method, doc=None, doc_suffix=None) -> None:
"""Set method's __name__ and __doc__ and add it to dct.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises ValueError instead of AssertionError
:raises ValueError: doc string must end with a period.
@@ -1115,7 +1115,7 @@
def get_site(cls, name=None):
"""Return the prefetched Site object.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises Exception instead of AssertionError for site mismatch
:raises Exception: method called for multiple sites without
@@ -1338,7 +1338,7 @@
Check that the default site is a Wikimedia site.
Use en.wikipedia.org as a fallback.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises Exception instead of AssertionError
:raises Exception: "site" or "sites" attribute is missing or
@@ -1498,7 +1498,7 @@
def execute(self, args: list[str], **kwargs):
"""Run :func:`tests.utils.execute_pwb` with default site.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
pass all arguments to :func:`tests.utils.execute_pwb`; make
this method public.
@@ -1583,7 +1583,7 @@
instead: str | bool | None) -> Any:
"""Build a deprecation warning result.
- .. versionchanged:: 9.3
+ .. version-changed:: 9.3
raises TypeError instead of AssertionError
:raises TypeError: invalid *instead* type
diff --git a/tests/basepage.py b/tests/basepage.py
index a611768..504ac7a 100644
--- a/tests/basepage.py
+++ b/tests/basepage.py
@@ -16,7 +16,7 @@
"""Enable abstract methods in TestCase-based base classes.
- .. versionadded:: 10.3
+ .. version-added:: 10.3
"""
@@ -38,7 +38,7 @@
def setup_page(self) -> None:
"""Subclasses must implement this to assign self._page.
- .. versionadded:: 10.3
+ .. version-added:: 10.3
"""
diff --git a/tests/gui_tests.py b/tests/gui_tests.py
index 9ff4a7d..7a874af 100755
--- a/tests/gui_tests.py
+++ b/tests/gui_tests.py
@@ -61,10 +61,10 @@
def setUpModule() -> None:
"""Skip tests if tkinter or PIL is not installed.
- .. versionchanged:: 7.7
+ .. version-changed:: 7.7
skip test if ``PYWIKIBOT_TEST_GUI`` environment variable is not
set.
- .. versionchanged:: 9.5
+ .. version-changed:: 9.5
:envvar:`PYWIKIBOT_TEST_GUI` environment variable was removed.
``pytest`` with ``pytest-xvfb `` extension is required for this
tests on github actions.
diff --git a/tests/hooks/__init__.py b/tests/hooks/__init__.py
index b9e3b06..c6b1b4b 100644
--- a/tests/hooks/__init__.py
+++ b/tests/hooks/__init__.py
@@ -1,6 +1,6 @@
"""Local pre-commit hooks for CI tests.
-.. versionadded:: 10.3
+.. version-added:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/tests/hooks/copyright_fixer.py b/tests/hooks/copyright_fixer.py
index d3fa734..ccd108a 100755
--- a/tests/hooks/copyright_fixer.py
+++ b/tests/hooks/copyright_fixer.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""Pre-commit hook to set the leftmost copyright year.
-.. versionadded:: 10.3
+.. version-added:: 10.3
"""
#
# (C) Pywikibot team, 2025
diff --git a/tests/pwb/print_argv.py b/tests/pwb/print_argv.py
index fd08973..0f8aa57 100755
--- a/tests/pwb/print_argv.py
+++ b/tests/pwb/print_argv.py
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
"""Script that forms part of pwb_tests.
-.. versionadded:: 7.0
+.. version-added:: 7.0
"""
#
-# (C) Pywikibot team, 2021
+# (C) Pywikibot team, 2021-2025
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/superset_tests.py b/tests/superset_tests.py
index 7977f2f..68b6db8 100755
--- a/tests/superset_tests.py
+++ b/tests/superset_tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Tests for superset module.
-.. versionadded:: 9.2
+.. version-added:: 9.2
"""
#
# (C) Pywikibot team, 2024-2025
diff --git a/tests/utils.py b/tests/utils.py
index afe9743..1457ffa 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -292,7 +292,7 @@
def is_cached(self, key: str) -> bool:
"""Return whether the key is cached.
- .. versionadded:: 8.3
+ .. version-added:: 8.3
"""
return key in self._cache
@@ -416,7 +416,7 @@
def login(self, *args, cookie_only=False, **kwargs) -> None:
"""Overwrite login which is called when a site is initialized.
- .. versionadded:: 8.0.4
+ .. version-added:: 8.0.4
"""
if cookie_only:
return
@@ -467,9 +467,9 @@
def execute(command: list[str], *, data_in=None, timeout=None):
"""Execute a command and capture outputs.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
*error* parameter was removed.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
parameters except *command* are keyword only.
:param command: executable to run and arguments to use
@@ -518,11 +518,11 @@
overrides: dict[str, str] | None = None) -> dict[str, Any]:
"""Execute the pwb.py script and capture outputs.
- .. versionchanged:: 8.2
+ .. version-changed:: 8.2
the *error* parameter was removed.
- .. versionchanged:: 9.1
+ .. version-changed:: 9.1
parameters except *args* are keyword only.
- .. versionchanged:: 10.4
+ .. version-changed:: 10.4
coverage is used if running github actions and a temporary file
is used for overrides.
@@ -612,8 +612,8 @@
.. note:: The last sample uses Python 3.10 syntax.
- .. versionadded:: 6.2
- .. versionchanged:: 9.3
+ .. version-added:: 6.2
+ .. version-changed:: 9.3
*code* parameter was added
:param exceptions: Exceptions to let test skip
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1221594?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: Id8d15264aa2990bed0765f389fea26d1d99fc6f2
Gerrit-Change-Number: 1221594
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot