jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/342481 )
Change subject: Deprecate unused argument ......................................................................
Deprecate unused argument
Change-Id: I855eaad6cfb3aee793249277b8e4d31e5fa14e28 --- M pywikibot/cosmetic_changes.py M pywikibot/page.py 2 files changed, 8 insertions(+), 9 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index b5bc6db..e160467 100755 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -72,7 +72,7 @@
from pywikibot import config, textlib from pywikibot.textlib import _MultiTemplateMatchBuilder -from pywikibot.tools import deprecate_arg, first_lower, first_upper +from pywikibot.tools import deprecated_args, first_lower, first_upper from pywikibot.tools import MediaWikiVersion
@@ -199,13 +199,12 @@
"""Cosmetic changes toolkit."""
- @deprecate_arg('debug', 'diff') - def __init__(self, site, diff=False, redirect=False, namespace=None, - pageTitle=None, ignore=CANCEL_ALL): + @deprecated_args(debug='diff', redirect=None) + def __init__(self, site, diff=False, namespace=None, pageTitle=None, + ignore=CANCEL_ALL): """Constructor.""" self.site = site self.diff = diff - self.redirect = redirect try: self.namespace = self.site.namespaces.resolve(namespace).pop(0) except (KeyError, TypeError, IndexError): diff --git a/pywikibot/page.py b/pywikibot/page.py index e953da0..c17ec0c 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -1266,16 +1266,16 @@ if not cc: return
- # cc depends on page directly and via several other imports - from pywikibot.cosmetic_changes import CosmeticChangesToolkit # noqa old = self.text pywikibot.log(u'Cosmetic changes for %s-%s enabled.' % (family, self.site.lang)) + # cc depends on page directly and via several other imports + from pywikibot.cosmetic_changes import ( + CANCEL_MATCH, CosmeticChangesToolkit) # noqa ccToolkit = CosmeticChangesToolkit(self.site, - redirect=self.isRedirectPage(), namespace=self.namespace(), pageTitle=self.title(), - ignore=3) # CANCEL_MATCH + ignore=CANCEL_MATCH) self.text = ccToolkit.change(old) if comment and \ old.strip().replace('\r\n',
pywikibot-commits@lists.wikimedia.org