jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/611668 )
Change subject: Update claimit for py3 ......................................................................
Update claimit for py3
Bug: T257399 Change-Id: I8ee6d3d5e72cc523c56e8d3efc7b636cea4b83cb --- M scripts/claimit.py 1 file changed, 6 insertions(+), 9 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/claimit.py b/scripts/claimit.py index 254bf24..0cdfda0 100755 --- a/scripts/claimit.py +++ b/scripts/claimit.py @@ -47,12 +47,10 @@
""" # -# (C) Pywikibot team, 2013-2019 +# (C) Pywikibot team, 2013-2020 # # Distributed under the terms of the MIT license. # -from __future__ import absolute_import, division, unicode_literals - import pywikibot from pywikibot import pagegenerators, WikidataBot
@@ -67,7 +65,7 @@
use_from_page = None
- def __init__(self, generator, claims, exists_arg=''): + def __init__(self, generator, claims, exists_arg='') -> None: """ Initializer.
@@ -79,7 +77,7 @@ @type exists_arg: str """ self.availableOptions['always'] = True - super(ClaimRobot, self).__init__() + super().__init__() self.generator = generator self.claims = claims self.exists_arg = ''.join(x for x in exists_arg.lower() if x in 'pqst') @@ -88,7 +86,7 @@ pywikibot.output("'exists' argument set to '{}'" .format(self.exists_arg))
- def treat_page_and_item(self, page, item): + def treat_page_and_item(self, page, item) -> None: """Treat each page.""" for claim in self.claims: # The generator might yield pages from multiple sites @@ -97,7 +95,7 @@ item, claim.copy(), self.exists_arg, site)
-def main(*args): +def main(*args) -> None: """ Process command line arguments and invoke bot.
@@ -105,7 +103,6 @@
@param args: command line arguments @type args: str - @rtype: bool """ exists_arg = '' commandline_claims = [] @@ -125,7 +122,7 @@ commandline_claims.append(arg) if len(commandline_claims) % 2: pywikibot.error('Incomplete command line property-value pair.') - return False + return
claims = [] repo = pywikibot.Site().data_repository()
pywikibot-commits@lists.wikimedia.org