jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/634348 )
Change subject: [IMPR] Replaced basestring by str ......................................................................
[IMPR] Replaced basestring by str
Bug: T265128 Change-Id: I06258bd52e3ddd8ac9dcf995c351278bde18ca64 --- M scripts/capitalize_redirects.py M scripts/catall.py M scripts/category.py M scripts/category_redirect.py M scripts/clean_sandbox.py M scripts/commons_link.py M scripts/coordinate_import.py 7 files changed, 18 insertions(+), 17 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py index 99ca30e..601759d 100755 --- a/scripts/capitalize_redirects.py +++ b/scripts/capitalize_redirects.py @@ -32,6 +32,8 @@ # from __future__ import absolute_import, division, unicode_literals
+from typing import Tuple + import pywikibot from pywikibot import i18n, pagegenerators from pywikibot.bot import ( @@ -83,14 +85,13 @@ summary=comment)
-def main(*args): +def main(*args: Tuple[str, ...]): """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: str """ options = {}
diff --git a/scripts/catall.py b/scripts/catall.py index b1f6306..7b40fbb 100755 --- a/scripts/catall.py +++ b/scripts/catall.py @@ -27,6 +27,8 @@ # from __future__ import absolute_import, division, unicode_literals
+from typing import Tuple + import pywikibot from pywikibot import i18n, textlib from pywikibot.bot import QuitKeyboardInterrupt @@ -81,14 +83,13 @@ summary=i18n.twtranslate(site, 'catall-changing'))
-def main(*args): +def main(*args: Tuple[str, ...]): """ Process command line arguments and perform task.
If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: str """ docorrections = True start = 'A' diff --git a/scripts/category.py b/scripts/category.py index 51b19aa..ae695be 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -126,7 +126,7 @@
from contextlib import suppress from operator import methodcaller -from typing import Optional, Set +from typing import Optional, Tuple, Set
import pywikibot
@@ -1298,14 +1298,13 @@ pywikibot.stdout(tree)
-def main(*args) -> None: +def main(*args: Tuple[str, ...]) -> None: """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments. - @type args: str """ from_given = False to_given = False diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py index 6f26920..36c90cd 100755 --- a/scripts/category_redirect.py +++ b/scripts/category_redirect.py @@ -35,6 +35,7 @@
from contextlib import suppress from datetime import timedelta +from typing import Tuple
import pywikibot
@@ -485,14 +486,13 @@ edit_request_page.save(comment)
-def main(*args): +def main(*args: Tuple[str, ...]): """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: str """ options = {} for arg in pywikibot.handle_args(args): diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index 54b0b5d..44166a9 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -46,6 +46,8 @@ import sys import time
+from typing import Tuple + import pywikibot
from pywikibot import i18n, pagegenerators @@ -255,14 +257,13 @@ pywikibot.sleep(self.getOption('hours') * 60 * 60)
-def main(*args) -> None: +def main(*args: Tuple[str, ...]) -> None: """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: str """ opts = {} local_args = pywikibot.handle_args(args) diff --git a/scripts/commons_link.py b/scripts/commons_link.py index 8610600..495025e 100755 --- a/scripts/commons_link.py +++ b/scripts/commons_link.py @@ -33,6 +33,7 @@ from __future__ import absolute_import, division, unicode_literals
import re +from typing import Tuple
import pywikibot
@@ -114,14 +115,13 @@ pywikibot.output('Page {} is locked'.format(page.title()))
-def main(*args): +def main(*args: Tuple[str, ...]): """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments - @type args: str """ options = {}
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py index b37e987..754410d 100755 --- a/scripts/coordinate_import.py +++ b/scripts/coordinate_import.py @@ -41,7 +41,7 @@ # # Distributed under the terms of MIT License. # -from typing import Optional +from typing import Optional, Tuple
import pywikibot from pywikibot import pagegenerators, WikidataBot @@ -146,14 +146,13 @@ return True
-def main(*args) -> None: +def main(*args: Tuple[str, ...]) -> None: """ Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
- @param args: command line arguments - @type args: str + @param args: command line argument """ # Process global args and prepare generator args parser local_args = pywikibot.handle_args(args)
pywikibot-commits@lists.wikimedia.org