jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[doc] Fix/add typing hints in script's main function

Change-Id: Ie58239fe67a07eb27863785a71c0030f52101982
---
M scripts/add_text.py
M scripts/archive/capitalize_redirects.py
M scripts/archive/catall.py
M scripts/archive/commons_link.py
M scripts/archive/create_categories.py
M scripts/archive/data_ingestion.py
M scripts/archive/editarticle.py
M scripts/archivebot.py
M scripts/basic.py
M scripts/blockpageschecker.py
M scripts/category.py
M scripts/category_redirect.py
M scripts/change_pagelang.py
M scripts/checkimages.py
M scripts/claimit.py
M scripts/clean_sandbox.py
M scripts/commons_information.py
M scripts/commonscat.py
M scripts/coordinate_import.py
M scripts/cosmetic_changes.py
M scripts/delete.py
M scripts/djvutext.py
M scripts/download_dump.py
M scripts/fixing_redirects.py
M scripts/harvest_template.py
M scripts/illustrate_wikidata.py
M scripts/image.py
M scripts/imagetransfer.py
M scripts/interwiki.py
M scripts/interwikidata.py
M scripts/listpages.py
M scripts/login.py
M scripts/misspelling.py
M scripts/movepages.py
M scripts/newitem.py
M scripts/noreferences.py
M scripts/nowcommons.py
M scripts/pagefromfile.py
M scripts/parser_function_count.py
M scripts/patrol.py
M scripts/protect.py
M scripts/redirect.py
M scripts/reflinks.py
M scripts/replace.py
M scripts/replicate_wiki.py
M scripts/revertbot.py
M scripts/shell.py
M scripts/solve_disambiguation.py
M scripts/speedy_delete.py
M scripts/template.py
M scripts/templatecount.py
M scripts/touch.py
M scripts/transferbot.py
M scripts/unusedfiles.py
M scripts/upload.py
M scripts/version.py
M scripts/watchlist.py
M scripts/weblinkchecker.py
M scripts/welcome.py
59 files changed, 75 insertions(+), 117 deletions(-)

diff --git a/scripts/add_text.py b/scripts/add_text.py
index 63cdfd7..f1dc409 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -367,7 +367,7 @@
self.put_current(text, summary=self.opt.summary, minor=self.opt.minor)


-def main(*argv: Tuple[str, ...]) -> None:
+def main(*argv: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archive/capitalize_redirects.py b/scripts/archive/capitalize_redirects.py
index 46896af..d16535d 100755
--- a/scripts/archive/capitalize_redirects.py
+++ b/scripts/archive/capitalize_redirects.py
@@ -20,7 +20,7 @@
python pwb.py capitalize_redirects -start:B -always
"""
#
-# (C) Pywikibot team, 2006-2020
+# (C) Pywikibot team, 2006-2021
#
# Distributed under the terms of the MIT license.
#
@@ -84,7 +84,7 @@
summary=comment)


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archive/catall.py b/scripts/archive/catall.py
index 83d3f9a..60ef9b9 100755
--- a/scripts/archive/catall.py
+++ b/scripts/archive/catall.py
@@ -20,7 +20,7 @@
-onlynew : Only run on pages that do not yet have a category.
"""
#
-# (C) Pywikibot team, 2004-2020
+# (C) Pywikibot team, 2004-2021
#
# Distributed under the terms of the MIT license.
#
@@ -89,7 +89,7 @@
summary=i18n.twtranslate(site, 'catall-changing'))


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and perform task.

diff --git a/scripts/archive/commons_link.py b/scripts/archive/commons_link.py
index 2d914e1..4c94b9e 100755
--- a/scripts/archive/commons_link.py
+++ b/scripts/archive/commons_link.py
@@ -118,7 +118,7 @@
pywikibot.output('Page {} is locked'.format(page.title()))


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archive/create_categories.py b/scripts/archive/create_categories.py
index cc6caa9..41e6743 100755
--- a/scripts/archive/create_categories.py
+++ b/scripts/archive/create_categories.py
@@ -92,7 +92,7 @@
return super().skip_page(page)


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archive/data_ingestion.py b/scripts/archive/data_ingestion.py
index 20e4fa6..49f1521 100755
--- a/scripts/archive/data_ingestion.py
+++ b/scripts/archive/data_ingestion.py
@@ -303,7 +303,7 @@
return configuration


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archive/editarticle.py b/scripts/archive/editarticle.py
index 4c02521..2f73464 100755
--- a/scripts/archive/editarticle.py
+++ b/scripts/archive/editarticle.py
@@ -23,7 +23,7 @@
--watch
"""
#
-# (C) Pywikibot team, 2004-2020
+# (C) Pywikibot team, 2004-2021
#
# Distributed under the terms of the MIT license.
#
@@ -108,7 +108,7 @@
pywikibot.output('Nothing changed')


-def main(*args: Tuple[str, ...]):
+def main(*args: str):
"""
Process command line arguments and invoke bot.

diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index b9a815a..82246de 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -819,14 +819,13 @@
self.page.update(comment)


-def main(*args) -> None:
+def main(*args: 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
"""
filename = None
pagename = None
diff --git a/scripts/basic.py b/scripts/basic.py
index 8270def..0691d00 100755
--- a/scripts/basic.py
+++ b/scripts/basic.py
@@ -48,7 +48,6 @@
#
import pywikibot
from pywikibot import pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.bot import (
AutomaticTWSummaryBot,
ConfigParserBot,
@@ -126,7 +125,7 @@
self.put_current(text, summary=self.opt.summary)


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/blockpageschecker.py b/scripts/blockpageschecker.py
index f95d347..a710424 100755
--- a/scripts/blockpageschecker.py
+++ b/scripts/blockpageschecker.py
@@ -207,14 +207,13 @@
editor.edit(page.text)


-def main(*args):
+def main(*args: str) -> None:
"""
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
"""
# Loading the comments
global categoryToCheck, project_inserted
diff --git a/scripts/category.py b/scripts/category.py
index d38136b..36182ce 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -128,7 +128,7 @@

import pywikibot
from pywikibot import config, i18n, pagegenerators, textlib
-from pywikibot.backports import Set, Tuple
+from pywikibot.backports import Set
from pywikibot.bot import (
BaseBot,
Bot,
@@ -1304,7 +1304,7 @@
pywikibot.stdout(tree)


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py
index 7d487b5..96fb733 100755
--- a/scripts/category_redirect.py
+++ b/scripts/category_redirect.py
@@ -36,7 +36,6 @@

import pywikibot
from pywikibot import config, i18n, pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.bot import SingleSiteBot
from pywikibot.exceptions import (
CircularRedirectError,
@@ -493,7 +492,7 @@
edit_request_page.save(comment)


-def main(*args: Tuple[str, ...]):
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/change_pagelang.py b/scripts/change_pagelang.py
index ce8e85e..a3c7a38 100755
--- a/scripts/change_pagelang.py
+++ b/scripts/change_pagelang.py
@@ -116,14 +116,13 @@
pywikibot.output('Skipping ...\n')


-def main(*args):
+def main(*args: 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: unicode
"""
options = {}

diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 43197db..cee134e 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -1535,14 +1535,13 @@
self.report(self.unvertext, self.imageName, notification, head, smwl)


-def main(*args) -> bool:
+def main(*args: str) -> bool:
"""
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
"""
# Command line configurable parameters
repeat = True # Restart after having check all the images?
diff --git a/scripts/claimit.py b/scripts/claimit.py
index 299dd1d..2435615 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -97,14 +97,13 @@
item, claim.copy(), self.exists_arg, site)


-def main(*args) -> None:
+def main(*args: 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
"""
exists_arg = ''
commandline_claims = []
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index 869f5a9..6848c1d 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -47,7 +47,6 @@

import pywikibot
from pywikibot import i18n, pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.bot import Bot, ConfigParserBot
from pywikibot.exceptions import EditConflictError, NoPageError

@@ -261,7 +260,7 @@
pywikibot.sleep(self.opt.hours * 60 * 60)


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index 2fd1b4c..ac64b5b 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -9,7 +9,6 @@

import pywikibot
from pywikibot import i18n, pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.bot import ExistingPageBot, SingleSiteBot
from pywikibot.tools.formatter import color_format

@@ -157,7 +156,7 @@
self.put_current(text, summary=summary)


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index d1298dd..121ae81 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -505,14 +505,13 @@
return commonsPage.title(with_ns=False)


-def main(*args):
+def main(*args: 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
"""
options = {}
checkcurrent = False
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 377ce20..a2f9848 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -44,7 +44,6 @@

import pywikibot
from pywikibot import WikidataBot, pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.exceptions import CoordinateGlobeUnknownError


@@ -142,7 +141,7 @@
return True


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index 2eece60..d4e931d 100755
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -38,7 +38,6 @@
#
import pywikibot
from pywikibot import config, pagegenerators
-from pywikibot.backports import Tuple
from pywikibot.bot import (
AutomaticTWSummaryBot,
ExistingPageBot,
@@ -83,7 +82,7 @@
asynchronous=self.opt['async'])


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/delete.py b/scripts/delete.py
index b569fe5..dc217d1 100755
--- a/scripts/delete.py
+++ b/scripts/delete.py
@@ -59,7 +59,7 @@

import pywikibot
from pywikibot import i18n, pagegenerators
-from pywikibot.backports import DefaultDict, Set, Tuple
+from pywikibot.backports import DefaultDict, Set
from pywikibot.bot import CurrentPageBot
from pywikibot.page import Page
from pywikibot.site import Namespace
@@ -216,7 +216,7 @@
automatic_quit=True)


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/djvutext.py b/scripts/djvutext.py
index 9c5340b..09baf48 100755
--- a/scripts/djvutext.py
+++ b/scripts/djvutext.py
@@ -36,7 +36,6 @@

import pywikibot
from pywikibot import i18n
-from pywikibot.backports import Tuple
from pywikibot.bot import SingleSiteBot
from pywikibot.exceptions import NoPageError
from pywikibot.proofreadpage import ProofreadPage
@@ -119,7 +118,7 @@
self.userPut(page, old_text, new_text, summary=self.opt.summary)


-def main(*args: Tuple[str, ...]):
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/download_dump.py b/scripts/download_dump.py
index 558115f..26366c2 100755
--- a/scripts/download_dump.py
+++ b/scripts/download_dump.py
@@ -24,7 +24,6 @@

import pywikibot
from pywikibot import Bot
-from pywikibot.backports import Tuple
from pywikibot.comms.http import fetch


@@ -179,7 +178,7 @@
pywikibot.output('Done! File stored as ' + file_final_storepath)


-def main(*args: Tuple[str, ...]):
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py
index 5930dcf..6fc4ef1 100755
--- a/scripts/fixing_redirects.py
+++ b/scripts/fixing_redirects.py
@@ -208,14 +208,13 @@
self.put_current(newtext)


-def main(*args):
+def main(*args: 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
"""
featured = False
options = {}
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index daa02d6..68df846 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -346,14 +346,13 @@
item, claim, exists_arg, page.site, pywikibot.output)


-def main(*args) -> None:
+def main(*args: 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
"""
template_title = None

diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py
index 71c755f..2429f71 100755
--- a/scripts/illustrate_wikidata.py
+++ b/scripts/illustrate_wikidata.py
@@ -75,14 +75,13 @@
self.user_add_claim(item, newclaim, page.site)


-def main(*args) -> None:
+def main(*args: 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
"""
# Process global args and prepare generator args parser
local_args = pywikibot.handle_args(args)
diff --git a/scripts/image.py b/scripts/image.py
index 76e30ea..0f875c8 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -120,14 +120,13 @@
summary=summary)


-def main(*args):
+def main(*args: 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
"""
old_image = None
new_image = None
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py
index e3cb276..4dbfcce 100755
--- a/scripts/imagetransfer.py
+++ b/scripts/imagetransfer.py
@@ -328,14 +328,13 @@
return True


-def main(*args):
+def main(*args: 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
"""
target_code = None
target_family = None
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 3579259..67ba233 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -2342,13 +2342,12 @@
pywikibot.output('Dumpfile {} deleted'.format(tail))


-def main(*args):
+def main(*args: 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
"""
singlePageTitle = ''
opthintsonly = False
diff --git a/scripts/interwikidata.py b/scripts/interwikidata.py
index 2557e39..48235de 100755
--- a/scripts/interwikidata.py
+++ b/scripts/interwikidata.py
@@ -213,14 +213,13 @@
return target_item


-def main(*args) -> None:
+def main(*args: 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
"""
local_args = pywikibot.handle_args(args)
gen_factory = pagegenerators.GeneratorFactory()
diff --git a/scripts/listpages.py b/scripts/listpages.py
index c0ed999..d3b5f6c 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -87,7 +87,7 @@
&params;
"""
#
-# (C) Pywikibot team, 2008-2020
+# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
@@ -166,14 +166,13 @@
return fmt.format(num=num, page=self)


-def main(*args) -> None:
+def main(*args: 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
"""
notitle = False
fmt = '1'
diff --git a/scripts/login.py b/scripts/login.py
index a9808b9..4f4761b 100755
--- a/scripts/login.py
+++ b/scripts/login.py
@@ -85,14 +85,13 @@
oauth_token=oauth_token))


-def main(*args) -> None:
+def main(*args: 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
"""
logall = False
logout = False
diff --git a/scripts/misspelling.py b/scripts/misspelling.py
index 0928b58..d8cd4d6 100755
--- a/scripts/misspelling.py
+++ b/scripts/misspelling.py
@@ -26,7 +26,7 @@
# Distributed under the terms of the MIT license.
#
from itertools import chain
-from typing import Generator, Tuple
+from typing import Generator

import pywikibot
from pywikibot import i18n, pagegenerators
@@ -146,7 +146,7 @@
{'page': page.title()})


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/movepages.py b/scripts/movepages.py
index 237888b..05ba0c6 100755
--- a/scripts/movepages.py
+++ b/scripts/movepages.py
@@ -171,7 +171,7 @@
self.moveOne(page, newPageTitle)


-def main(*args) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/newitem.py b/scripts/newitem.py
index 570eb9c..6651756 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -20,7 +20,7 @@

"""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
@@ -185,14 +185,13 @@
page, callback=lambda _, exc: self._callback(page, exc))


-def main(*args) -> None:
+def main(*args: 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
"""
# Process global args and prepare generator args parser
local_args = pywikibot.handle_args(args)
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index 69692bf..d719948 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -736,14 +736,13 @@
self.put_current(self.addReferences(text), summary=self.comment)


-def main(*args) -> None:
+def main(*args: 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
"""
options = {}
gen = None
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index 927f901..6c90ded 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -369,14 +369,13 @@
self.exit()


-def main(*args):
+def main(*args: 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
"""
options = {}

diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py
index 6a76161..c8ddd9e 100755
--- a/scripts/pagefromfile.py
+++ b/scripts/pagefromfile.py
@@ -273,14 +273,13 @@
return location.end(), title, contents


-def main(*args) -> None:
+def main(*args: 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
"""
filename = 'dict.txt'
options = {}
diff --git a/scripts/parser_function_count.py b/scripts/parser_function_count.py
index 4bf7898..84d008e 100755
--- a/scripts/parser_function_count.py
+++ b/scripts/parser_function_count.py
@@ -43,7 +43,7 @@
functions will be listed.
"""
#
-# (C) Pywikibot team, 2013-2020
+# (C) Pywikibot team, 2013-2021
#
# Distributed under the terms of the MIT license.
#
@@ -176,7 +176,7 @@
summary=self.summary)


-def main(*args):
+def main(*args: str) -> None:
"""Process command line arguments and invoke ParserFunctionCountBot."""
local_args = pywikibot.handle_args(*args)
options = {}
diff --git a/scripts/patrol.py b/scripts/patrol.py
index a1cd050..f3c5077 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -391,7 +391,7 @@
break


-def main(*args):
+def main(*args: str) -> None:
"""Process command line arguments and invoke PatrolBot."""
# This factory is responsible for processing command line arguments
# that are also used by other scripts and that determine on which pages
diff --git a/scripts/protect.py b/scripts/protect.py
index dcf1096..20a378e 100755
--- a/scripts/protect.py
+++ b/scripts/protect.py
@@ -53,7 +53,7 @@
#
# Created by modifying delete.py
#
-# (C) Pywikibot team, 2008-2020
+# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
@@ -140,14 +140,13 @@
return levels[first_char.index(choice)]


-def main(*args):
+def main(*args: 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
"""
options = {}
message_properties = {}
diff --git a/scripts/redirect.py b/scripts/redirect.py
index 077990f..8d5b332 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -656,14 +656,13 @@
super().treat(page)


-def main(*args) -> None:
+def main(*args: 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
"""
options = {} # type: Dict[str, Any]
gen_options = {} # type: Dict[str, Any]
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 8e344bf..cfb2d14 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -734,14 +734,13 @@
self.generator.close()


-def main(*args):
+def main(*args: 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
"""
xml_filename = None
xml_start = None
diff --git a/scripts/replace.py b/scripts/replace.py
index f558502..89b63df 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -771,14 +771,13 @@
return pattern


-def main(*args):
+def main(*args: 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
"""
options = {}
gen = None
diff --git a/scripts/replicate_wiki.py b/scripts/replicate_wiki.py
index cfc8802..8b01f39 100755
--- a/scripts/replicate_wiki.py
+++ b/scripts/replicate_wiki.py
@@ -221,14 +221,13 @@
pywikibot.stdout('.', newline=False)


-def main(*args):
+def main(*args: 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
"""
my_args = pywikibot.handle_args(args)

diff --git a/scripts/revertbot.py b/scripts/revertbot.py
index 067968b..f771740 100755
--- a/scripts/revertbot.py
+++ b/scripts/revertbot.py
@@ -36,7 +36,7 @@

"""
#
-# (C) Pywikibot team, 2008-2020
+# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
@@ -147,14 +147,13 @@
myRevertBot = BaseRevertBot # noqa: N816


-def main(*args):
+def main(*args: 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
"""
options = {}

diff --git a/scripts/shell.py b/scripts/shell.py
index 694e99a..26a582f 100755
--- a/scripts/shell.py
+++ b/scripts/shell.py
@@ -13,7 +13,7 @@

If no arguments are given, the pywikibot library will not be loaded.
"""
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
@@ -21,7 +21,7 @@
import sys


-def main(*args):
+def main(*args: str) -> None:
"""Script entry point."""
args = list(args)
if '-noimport' in args:
diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py
index 84c5397..6ca824c 100755
--- a/scripts/solve_disambiguation.py
+++ b/scripts/solve_disambiguation.py
@@ -84,7 +84,7 @@
import re
from contextlib import suppress
from itertools import chain
-from typing import Generator, Optional, Tuple
+from typing import Generator, Optional

import pywikibot
from pywikibot import config
@@ -1382,7 +1382,7 @@
self.opt.pos = []


-def main(*args: Tuple[str, ...]) -> None:
+def main(*args: str) -> None:
"""
Process command line arguments and invoke bot.

diff --git a/scripts/speedy_delete.py b/scripts/speedy_delete.py
index fbe5e0f..9ac8fb7 100755
--- a/scripts/speedy_delete.py
+++ b/scripts/speedy_delete.py
@@ -20,7 +20,7 @@
NOTE: This script currently only works for the Wikipedia project.
"""
#
-# (C) Pywikibot team, 2007-2020
+# (C) Pywikibot team, 2007-2021
#
# Distributed under the terms of the MIT license.
#
@@ -475,7 +475,7 @@
self.saved_progress = None


-def main(*args):
+def main(*args: str) -> None:
"""Script entry point."""
pywikibot.handle_args(args) # No local args yet
site = pywikibot.Site()
diff --git a/scripts/template.py b/scripts/template.py
index d71e404..f2d7b84 100755
--- a/scripts/template.py
+++ b/scripts/template.py
@@ -206,14 +206,13 @@
summary=self.opt.summary)


-def main(*args) -> None:
+def main(*args: 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
"""
template_names = []
templates = {}
diff --git a/scripts/templatecount.py b/scripts/templatecount.py
index b1e93ab..9e58be0 100755
--- a/scripts/templatecount.py
+++ b/scripts/templatecount.py
@@ -140,14 +140,13 @@
yield template, list(gen)


-def main(*args) -> None:
+def main(*args: 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
"""
operation = None
args_list = []
diff --git a/scripts/touch.py b/scripts/touch.py
index 5a68ff0..2a591d8 100755
--- a/scripts/touch.py
+++ b/scripts/touch.py
@@ -82,14 +82,13 @@
'' if page.purge(**self.opt) else ' not'))


-def main(*args) -> None:
+def main(*args: 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
"""
options = {}

diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index df3b932..261618a 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -58,14 +58,13 @@
docuReplacements = {'&params;': pagegenerators.parameterHelp} # noqa: N816


-def main(*args) -> None:
+def main(*args: 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
"""
local_args = pywikibot.handle_args(args)

diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py
index 77dfc6d..5d05f5c 100755
--- a/scripts/unusedfiles.py
+++ b/scripts/unusedfiles.py
@@ -126,14 +126,13 @@
board.new_topic(title, content)


-def main(*args):
+def main(*args: 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
"""
options = {}
total = None
diff --git a/scripts/upload.py b/scripts/upload.py
index 75c7b4a..d83d3fa 100755
--- a/scripts/upload.py
+++ b/scripts/upload.py
@@ -52,7 +52,7 @@
parameter, and for a description.
"""
#
-# (C) Pywikibot team, 2003-2020
+# (C) Pywikibot team, 2003-2021
#
# Distributed under the terms of the MIT license.
#
@@ -95,14 +95,13 @@
return chunk_size


-def main(*args) -> None:
+def main(*args: 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
"""
url = ''
description = []
diff --git a/scripts/version.py b/scripts/version.py
index a4ce0a2..e4fa31a 100755
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -44,7 +44,7 @@
WMF_CACERT = 'MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs'


-def main(*args) -> None:
+def main(*args: str) -> None:
"""Print pywikibot version and important settings."""
pywikibot.output('Pywikibot: ' + getversion())
pywikibot.output('Release version: ' + pywikibot.__version__)
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index 1751277..c6f53f4 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -20,7 +20,7 @@
user-config.py
"""
#
-# (C) Pywikibot team, 2005-2020
+# (C) Pywikibot team, 2005-2021
#
# Distributed under the terms of the MIT license.
#
@@ -99,14 +99,13 @@
refresh(site)


-def main(*args):
+def main(*args: 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
"""
opt_all = False
opt_new = False
diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index e37b8fd..11880e1 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -622,14 +622,13 @@
return i


-def main(*args):
+def main(*args: 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
"""
gen = None
xmlFilename = None
diff --git a/scripts/welcome.py b/scripts/welcome.py
index d50650c..6009db2 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -987,11 +987,10 @@
pywikibot.warning('Unknown option "{}"'.format(arg))


-def main(*args) -> None:
+def main(*args: str) -> None:
"""Invoke bot.

:param args: command line arguments
- :type args: str
"""
handle_args(args)
if globalvar.offset and globalvar.timeoffset:

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie58239fe67a07eb27863785a71c0030f52101982
Gerrit-Change-Number: 721973
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged