jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[DOCS] Pywikibot: Add missing docsting params and update comments

Desciption for following params are added:

-In _collections.py param key of normalizeKey method of class BaseDataDict
-In chars.py param string of string_to_ascii_html method CHECK CLASS
-In djvu.py param n of page_info method of class DjVuFile
-In djvu.py param data of _remove_control_chars method of class DjVuFile
-In djvu.py param n of get_page method of class DjVuFile
-In djvu.py param n of whiten_page method of class DjVuFile
-In djvu.py param n of delete_page method of class DjVuFile

Comment updated
-In _deprecate.py param obj of add_decorated_full_name method, message typo removed

Bug: T184115
Change-Id: Ib965401e1459e6463a8cd692eefd83ef248d63e5
---
M pywikibot/page/_collections.py
M pywikibot/tools/_deprecate.py
M pywikibot/tools/chars.py
M pywikibot/tools/djvu.py
4 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/pywikibot/page/_collections.py b/pywikibot/page/_collections.py
index 7cd7c4a..6668a45 100644
--- a/pywikibot/page/_collections.py
+++ b/pywikibot/page/_collections.py
@@ -67,7 +67,11 @@

@staticmethod
def normalizeKey(key) -> str:
- """Helper function to return language codes of a site object."""
+ """Helper function to return language codes of a site object.
+
+ :param key: input key to be normalized
+ :type key: pywikibot.site.BaseSite or str
+ """
if isinstance(key, BaseSite):
key = key.lang
return key
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index 1c874af..de68157 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -50,7 +50,7 @@
This must be done on all decorators that are chained together, otherwise
the second decorator will have the wrong full name.

- :param obj: A object being decorated
+ :param obj: An object being decorated
:type obj: object
:param stacklevel: level to use
:type stacklevel: int
diff --git a/pywikibot/tools/chars.py b/pywikibot/tools/chars.py
index c162555..a2fd898 100644
--- a/pywikibot/tools/chars.py
+++ b/pywikibot/tools/chars.py
@@ -44,7 +44,10 @@


def string_to_ascii_html(string: str) -> str:
- """Convert unicode chars of str to HTML entities if chars are not ASCII."""
+ """Convert unicode chars of str to HTML entities if chars are not ASCII.
+
+ :param string: String to update
+ """
html = []
for c in string:
cord = ord(c)
diff --git a/pywikibot/tools/djvu.py b/pywikibot/tools/djvu.py
index e4f7c65..83c2873 100644
--- a/pywikibot/tools/djvu.py
+++ b/pywikibot/tools/djvu.py
@@ -135,6 +135,8 @@
"""
Return a tuple (id, (size, dpi)) for page n of djvu file.

+ :param n: page n of djvu file
+ :type n: int
:param force: if True, refresh the cached data
:type force: bool
"""
@@ -206,6 +208,8 @@
"""Remove djvu format control characters.

See http://djvu.sourceforge.net/doc/man/djvused.html for control chars.
+
+ :param data: the data checked for djvu format control characters
"""
txt = data.decode('utf-8')
# vertical tab (\013=\x0b): remove
@@ -224,6 +228,8 @@
"""
Get page n for djvu file.

+ :param n: page n of djvu file
+ :type n: int
:param force: if True, refresh the cached data
:type force: bool
"""
@@ -238,7 +244,11 @@

@check_page_number
def whiten_page(self, n):
- """Replace page 'n' of djvu file with a blank page."""
+ """Replace page 'n' of djvu file with a blank page.
+
+ :param n: page n of djvu file
+ :type n: int
+ """
# tmp files for creation/insertion of a white page.
white_ppm = os.path.join(self.dirname, 'white_page.ppm')
white_djvu = os.path.join(self.dirname, 'white_page.djvu')
@@ -285,7 +295,11 @@

@check_page_number
def delete_page(self, n):
- """Delete page 'n' of djvu file ."""
+ """Delete page 'n' of djvu file.
+
+ :param n: page n of djvu file
+ :type n: int
+ """
n_tot = self.number_of_images()

# Check n is in valid range and set ref_page number for final checks.

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib965401e1459e6463a8cd692eefd83ef248d63e5
Gerrit-Change-Number: 759535
Gerrit-PatchSet: 1
Gerrit-Owner: Lorcan <lorcanjames1@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged