jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[doc] fix some wrong docstrings

Change-Id: I057562091881de7c432e17fca6076f172ad36fc7
---
M pywikibot/comms/eventstreams.py
M pywikibot/comms/http.py
M pywikibot/page/__init__.py
M pywikibot/site/_apisite.py
M pywikibot/site/_datasite.py
M scripts/archive/wikisourcetext.py
M scripts/category.py
M tests/wikibase_edit_tests.py
8 files changed, 24 insertions(+), 35 deletions(-)

diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 93f872b..662598a 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -184,7 +184,7 @@
assumed as default.

You may register multiple filters for each type of filter.
- The behaviour of filter type is as follows::
+ The behaviour of filter type is as follows:

- B{'none'}: Skip if the any filter matches. Otherwise check 'all'.
- B{'all'}: Skip if not all filter matches. Otherwise check 'any':
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 98ec743..b31f531 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -223,7 +223,7 @@
document root '/'.

@param site: The Site to connect to
- @type: site: pywikibot.site.BaseSite
+ @type site: pywikibot.site.BaseSite
@param uri: the URI to retrieve
@keyword charset: Either a valid charset (usable for str.decode()) or None
to automatically chose the charset from the returned header (defaults
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 16c2e36..19fc629 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -2452,7 +2452,7 @@
FileInfo: provided revision will be used.
@type revision: None or FileInfo
@return: True if download is successful, False otherwise.
- @raise: IOError if filename cannot be written for any reason.
+ @raise IOError: if filename cannot be written for any reason.
"""
if filename is None:
filename = self.title(as_filename=True, with_ns=False)
@@ -3133,7 +3133,7 @@
) -> Iterable[Tuple[Page, Revision]]:
"""Yield tuples describing this user's deleted edits.

- @param: total: Limit results to this number of pages
+ @param total: Limit results to this number of pages
@keyword start: Iterate contributions starting at this Timestamp
@keyword end: Iterate contributions ending at this Timestamp
@keyword reverse: Iterate oldest contributions first (default: newest)
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index eb63661..04c66ea 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -633,19 +633,17 @@
"""Return true if the user has new messages, and false otherwise."""
return 'messages' in self.userinfo

- def mediawiki_messages(self, keys, lang=None):
+ def mediawiki_messages(self, keys, lang: Optional[str] = None):
"""Fetch the text of a set of MediaWiki messages.

The returned dict uses each key to store the associated message.

- @see: U{https://www.mediawiki.org/wiki/API:Allmessages}
+ @see: https://www.mediawiki.org/wiki/API:Allmessages

@param keys: MediaWiki messages to fetch
@type keys: iterable of str
@param lang: a language code, default is self.lang
- @type lang: str or None
-
- @rtype OrderedDict
+ @rtype: OrderedDict
"""
amlang = lang or self.lang
if not all(amlang in _mw_msg_cache
@@ -2931,7 +2929,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/site/_datasite.py b/pywikibot/site/_datasite.py
index 89ea1f6..76de520 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -890,7 +890,7 @@
"""
Set aliases for a single Wikibase entity.

- See self._wbset_action(self, itemdef, action, action_data, **kwargs)
+ See self._wbset_action() for parameters
"""
return self._wbset_action(itemdef, 'wbsetaliases', aliases, **kwargs)

@@ -898,7 +898,7 @@
"""
Set description for a single Wikibase entity.

- See self._wbset_action(self, itemdef, action, action_data, **kwargs)
+ See self._wbset_action()
"""
return self._wbset_action(itemdef, 'wbsetdescription', description,
**kwargs)
@@ -907,7 +907,7 @@
"""
Set label for a single Wikibase entity.

- See self._wbset_action(self, itemdef, action, action_data, **kwargs)
+ See self._wbset_action() for parameters
"""
return self._wbset_action(itemdef, 'wbsetlabel', label, **kwargs)

@@ -915,6 +915,6 @@
"""
Set, remove or modify a sitelink on a Wikibase item.

- See self._wbset_action(self, itemdef, action, action_data, **kwargs)
+ See self._wbset_action() for parameters
"""
return self._wbset_action(itemdef, 'wbsetsitelink', sitelink, **kwargs)
diff --git a/scripts/archive/wikisourcetext.py b/scripts/archive/wikisourcetext.py
index bf076b9..1ad7ea5 100644
--- a/scripts/archive/wikisourcetext.py
+++ b/scripts/archive/wikisourcetext.py
@@ -53,7 +53,7 @@
-always don't bother asking to confirm any of the changes.
"""
#
-# (C) Pywikibot team, 2016-2020
+# (C) Pywikibot team, 2016-2021
#
# Distributed under the terms of the MIT license.
#
@@ -167,7 +167,7 @@

@param page: page to be treated.
@type page: ProofreadPage
- @raises: pywikibot.Error
+ @raises pywikibot.Error: Page must be a ProofreadPage object
"""
if not isinstance(page, ProofreadPage):
raise pywikibot.Error('Page {} must be a ProofreadPage object.'
diff --git a/scripts/category.py b/scripts/category.py
index 15933e2..772b575 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -966,20 +966,15 @@
categories it currently is.

@param cat_title: a title of the category to process.
- @type: str
-
@param cat_db: a CategoryDatabase object.
- @type: CategoryDatabase object
-
+ @type cat_db: CategoryDatabase object
@param namespaces: namespaces to focus on.
- @type: iterable of pywikibot.Namespace
-
+ @type namespaces: iterable of pywikibot.Namespace
@param comment: a custom summary for edits.
- @type: str
"""

- def __init__(self, cat_title, cat_db, namespaces=None, comment=None
- ) -> None:
+ def __init__(self, cat_title: str, cat_db, namespaces=None,
+ comment: Optional[str] = None) -> None:
"""Initializer."""
self.cat_title = cat_title
self.cat_db = cat_db
@@ -1004,13 +999,11 @@
should always use current_cat = original_cat.

@param member: a page to process.
- @type: pywikibot.Page
-
+ @type member: pywikibot.Page
@param original_cat: original category to replace.
- @type: pywikibot.Category
-
+ @type original_cat: pywikibot.Category
@param current_cat: a category which is questioned.
- @type: pywikibot.Category
+ @type current_cat: pywikibot.Category
"""
class CatContextOption(ContextOption):
"""An option to show more and more context and categories."""
@@ -1032,7 +1025,7 @@
class CatIntegerOption(IntegerOption):
"""An option allowing a range of integers."""

- def list_categories(self, cat_list, prefix='') -> None:
+ def list_categories(self, cat_list, prefix: str = '') -> None:
"""
Output categories in one or two columns.

@@ -1041,10 +1034,8 @@
options.

@param cat_list: sorted iterable of category titles to output.
- @type: iterable of str
-
+ @type cat_list: iterable of str
@param prefix: a prefix to assigned number index.
- @type: str
"""
# can we can output in two columns?
count = len(cat_list)
diff --git a/tests/wikibase_edit_tests.py b/tests/wikibase_edit_tests.py
index 90e0d44..44b0899 100644
--- a/tests/wikibase_edit_tests.py
+++ b/tests/wikibase_edit_tests.py
@@ -212,7 +212,7 @@
Return an item without any existing claims of the given property.

@param repo: repository to fetch item from
- @type: pywikibot.site.DataSite
+ @type repo: pywikibot.site.DataSite
@param prop: P-value of the property to scrub
@return: scrubbed item
@rtype: pywikibot.ItemPage

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I057562091881de7c432e17fca6076f172ad36fc7
Gerrit-Change-Number: 674449
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged