jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Sphinx: replace :note: field element with .. note:: directive

Bug: T308400
Change-Id: I2765688a5e3c343acbafed1e82b172701c9d6960
---
M pywikibot/data/api.py
M pywikibot/logentries.py
M pywikibot/page/_pages.py
M pywikibot/page/_wikibase.py
M pywikibot/site/_generators.py
M pywikibot/tools/__init__.py
M scripts/category.py
7 files changed, 48 insertions(+), 38 deletions(-)

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 59d6dcc..8e821da 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1314,9 +1314,9 @@

URL encodes the parameters provided by _encoded_items()

- :note: Not all parameters are sorted, therefore for two given
- CachedRequest objects with equal _params, the result of
- _http_param_string() is not necessarily equal.
+ .. note:: Not all parameters are sorted, therefore for two given
+ CachedRequest objects with equal _params, the result of
+ _http_param_string() is not necessarily equal.
"""
return encode_url(self._encoded_items())

diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 33d36df..fcc3cdc 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -372,9 +372,10 @@
Return the class corresponding to the @logtype string parameter.

:return: specified subclass of LogEntry
- :note: this class method cannot verify whether the given logtype
- already exits for a given site; to verify use Site.logtypes
- or use the get_valid_entry_class instance method instead.
+
+ .. note:: this class method cannot verify whether the given logtype
+ already exits for a given site; to verify use Site.logtypes
+ or use the get_valid_entry_class instance method instead.
"""
if logtype not in cls._logtypes:
bases = (OtherLogEntry, ) # type: Tuple['LogEntry', ...]
diff --git a/pywikibot/page/_pages.py b/pywikibot/page/_pages.py
index dca6379..848b7c0 100644
--- a/pywikibot/page/_pages.py
+++ b/pywikibot/page/_pages.py
@@ -10,8 +10,7 @@
various pages for Proofread Extensions are defines in
``pywikibot.proofreadpage``.

-..note::
- `Link` objects represent a wiki-page's title, while
+..note:: `Link` objects represent a wiki-page's title, while
:class:`pywikibot.Page` objects (defined here) represent the page
itself, including its contents.
"""
@@ -1377,7 +1376,7 @@
minor and botflag parameters are set to False which prevents hiding
the edit when it becomes a real edit due to a bug.

- :note: This discards content saved to self.text.
+ .. note:: This discards content saved to self.text.
"""
if self.exists():
# ensure always get the page text and not to change it.
diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index 0a342bc..70246a4 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -536,9 +536,10 @@
:param force: override caching
:raise NotImplementedError: a value in args or kwargs
:return: actual data which entity holds
- :note: dicts returned by this method are references to content
- of this entity and their modifying may indirectly cause
- unwanted change to the live content
+
+ .. note:: dicts returned by this method are references to content
+ of this entity and their modifying may indirectly cause
+ unwanted change to the live content
"""
if args or kwargs:
raise NotImplementedError(
@@ -942,9 +943,11 @@
redirect, do not raise an exception.
:raise NotImplementedError: a value in args or kwargs
:return: actual data which entity holds
- :note: dicts returned by this method are references to content of this
- entity and their modifying may indirectly cause unwanted change to
- the live content
+
+ .. note:: dicts returned by this method are
+ references to content of this entity and
+ their modifying may indirectly cause
+ unwanted change to the live content
"""
data = super().get(force, *args, **kwargs)

@@ -1245,9 +1248,11 @@
:param force: override caching
:raise NotImplementedError: a value in args or kwargs
:return: actual data which entity holds
- :note: dicts returned by this method are references to content of this
- entity and their modifying may indirectly cause unwanted change to
- the live content
+
+ .. note:: dicts returned by this method are
+ references to content of this entity and
+ their modifying may indirectly cause
+ unwanted change to the live content
"""
if args or kwargs:
raise NotImplementedError(
@@ -1968,9 +1973,10 @@
redirect, do not raise an exception.
:type get_redirect: bool
:raise NotImplementedError: a value in args or kwargs
- :note: dicts returned by this method are references to content
- of this entity and their modifying may indirectly cause
- unwanted change to the live content
+
+ .. note:: dicts returned by this method are references to content
+ of this entity and their modifying may indirectly cause
+ unwanted change to the live content
"""
data = super().get(force, *args, **kwargs)

@@ -2202,9 +2208,10 @@
Fetch all form data, and cache it.

:param force: override caching
- :note: dicts returned by this method are references to content
- of this entity and their modifying may indirectly cause
- unwanted change to the live content
+
+ .. note:: dicts returned by this method are references to content
+ of this entity and their modifying may indirectly cause
+ unwanted change to the live content
"""
data = super().get(force=force)

diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index ce94db9..3edbd7a 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -1097,9 +1097,9 @@

.. seealso:: :api:`Blocks`

- .. note::
- logevents only logs user blocks, while this method iterates
- all blocks including IP ranges.
+ .. note:: logevents only logs user blocks,
+ while this method iterates all blocks
+ including IP ranges.
.. warning::
``iprange`` parameter cannot be used together with ``users``.

@@ -1226,8 +1226,7 @@

.. seealso:: :api:`Logevents`

- .. note::
- logevents with `logtype='block'` only logs user blocks
+ .. note:: logevents with `logtype='block'` only logs user blocks
whereas `site.blocks` iterates all blocks including IP ranges.

:param logtype: only iterate entries of this type
@@ -1237,9 +1236,11 @@
:type page: pywikibot.Page or str
:param namespace: namespace(s) to retrieve logevents from
:type namespace: int or Namespace or an iterable of them
- :note: due to an API limitation, if namespace param contains multiple
- namespaces, log entries from all namespaces will be fetched from
- the API and will be filtered later during iteration.
+
+ .. note:: due to an API limitation,
+ if namespace param contains multiple namespaces,
+ log entries from all namespaces will be fetched from
+ the API and will be filtered later during iteration.
:param start: only iterate entries from and after this Timestamp
:type start: Timestamp or ISO date string
:param end: only iterate entries up to and through this Timestamp
@@ -1548,7 +1549,7 @@
or typing.Iterable[str]
:keyword revids: Get revisions by their ID

- :note: either titles or revids must be set but not both
+ .. note:: either titles or revids must be set but not both

:param start: Iterate revisions starting at this Timestamp
:param end: Iterate revisions ending at this Timestamp
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index acb91a8..9bc7ad0 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -369,9 +369,11 @@

.. 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 T179115 and T200357.
+ .. 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 T179115 and T200357.
"""
first = string[:1]
return (_first_upper_exception(first) or first.upper()) + string[1:]
diff --git a/scripts/category.py b/scripts/category.py
index 7386033..8db8a1d 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -1039,8 +1039,8 @@
to move it to one of original_cat's sub- or super-categories.
Recursively run through subcategories' subcategories.

- :note: current_cat is only used for internal recursion. You
- should always use ``current_cat = original_cat``.
+ .. note:: current_cat is only used for internal recursion. You
+ should always use ``current_cat = original_cat``.
:param member: a page to process.
:param original_cat: original category to replace.
:param current_cat: a category which is questioned.

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2765688a5e3c343acbafed1e82b172701c9d6960
Gerrit-Change-Number: 791730
Gerrit-PatchSet: 6
Gerrit-Owner: Klein Muçi <kleinmuci@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged