Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/810538 )

Change subject: [IMPR] Add type hints to harvest_template.py
......................................................................

[IMPR] Add type hints to harvest_template.py

Change-Id: I257b0d8febd11c8a3425ab07773d16b6d5d939fa
---
M scripts/harvest_template.py
1 file changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 137cfd7..7bf679c 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -104,7 +104,7 @@
 import pywikibot
 from pywikibot import pagegenerators as pg
 from pywikibot import textlib
-from pywikibot.backports import List
+from pywikibot.backports import List, Tuple
 from pywikibot.bot import ConfigParserBot, OptionHandler, WikidataBot
 from pywikibot.exceptions import (
     InvalidPageError,
@@ -264,7 +264,9 @@
             return default is not local
         return local or default

-    def treat_page_and_item(self, page, item) -> None:
+    def treat_page_and_item(self,
+                            page: pywikibot.page.BasePage,
+                            item: pywikibot.page.ItemPage) -> None:
         """Process a single page/item."""
         if willstop:
             raise KeyboardInterrupt
@@ -287,7 +289,10 @@
             for field_item in fielddict.items():
                 self.treat_field(page, item, field_item)

-    def treat_field(self, page, item, field_item):
+    def treat_field(self,
+                    page: pywikibot.page.BasePage,
+                    item: pywikibot.page.ItemPage,
+                    field_item: Tuple[str, str]) -> None:
         """Process a single field of template fileddict."""
         field, value = field_item
         field = field.strip()

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/810538
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: I257b0d8febd11c8a3425ab07773d16b6d5d939fa
Gerrit-Change-Number: 810538
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to