jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/644961 )

Change subject: Add docstrings to catall.py, change_pagelang.py, claimit.py
......................................................................

Add docstrings to catall.py, change_pagelang.py, claimit.py

Bug: T184115
Change-Id: I6c2cec6bd6bcd49857aed6b61b61d76bd02718a2
---
M scripts/catall.py
M scripts/change_pagelang.py
M scripts/claimit.py
3 files changed, 32 insertions(+), 8 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/catall.py b/scripts/catall.py
index cb0ea9b..9fa5ced 100755
--- a/scripts/catall.py
+++ b/scripts/catall.py
@@ -32,12 +32,17 @@

 if PYTHON_VERSION >= (3, 9):
     Tuple = tuple
+    List = list
 else:
-    from typing import Tuple
+    from typing import List, Tuple


-def choosecats(pagetext):
-    """Coose categories."""
+def choosecats(pagetext: str) -> List[str]:
+    """Choose categories.
+
+    @param pagetext: The text of the page
+    @return: chosen list which contains all the choices
+    """
     chosen = []
     done = False
     length = 1000
@@ -73,8 +78,13 @@
     return chosen


-def make_categories(page, list, site=None):
-    """Make categories."""
+def make_categories(page, list: list, site=None):
+    """Make categories.
+
+    @param page: The page to update and save
+    @type page: pywikibot.page.BasePage
+    @param list: The list which contains categories
+    """
     if site is None:
         site = pywikibot.Site()
     pllist = []
diff --git a/scripts/change_pagelang.py b/scripts/change_pagelang.py
index d914485..4060c7b 100755
--- a/scripts/change_pagelang.py
+++ b/scripts/change_pagelang.py
@@ -51,7 +51,11 @@
             'Either "always" or "never" must be set but not both'

     def changelang(self, page):
-        """Set page language."""
+        """Set page language.
+
+        @param page: The page to update and save
+        @type page: pywikibot.page.BasePage
+        """
         token = self.site.get_tokens(['csrf']).get('csrf')
         parameters = {'action': 'setpagelanguage',
                       'title': page.title(),
@@ -65,7 +69,11 @@
             page.title(as_link=True), self.opt.setlang))

     def treat(self, page):
-        """Treat a page."""
+        """Treat a page.
+
+        @param page: The page to treat
+        @type page: pywikibot.page.BasePage
+        """
         # Current content language of the page and site language
         parameters = {'action': 'query',
                       'prop': 'info',
diff --git a/scripts/claimit.py b/scripts/claimit.py
index 6825d17..58652da 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -87,7 +87,13 @@
                              .format(self.exists_arg))

     def treat_page_and_item(self, page, item) -> None:
-        """Treat each page."""
+        """Treat each page.
+
+        @param page: The page to update and change
+        @type page: pywikibot.page.BasePage
+        @param item: The item to treat
+        @type item: pywikibot.page.ItemPage
+        """
         for claim in self.claims:
             # The generator might yield pages from multiple sites
             site = page.site if page is not None else None

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/644961
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6c2cec6bd6bcd49857aed6b61b61d76bd02718a2
Gerrit-Change-Number: 644961
Gerrit-PatchSet: 5
Gerrit-Owner: Shubham656jain <[email protected]>
Gerrit-Reviewer: Ammarpad <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: Zhuyifei1999 <[email protected]>
Gerrit-Reviewer: Zoranzoki21 <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to