jenkins-bot has submitted this change and it was merged.
Change subject: CosmeticChangesBot shows diff twice ......................................................................
CosmeticChangesBot shows diff twice
Rename CosmeticChangesToolkit option 'debug' to 'diff', as that is its only function.
CosmeticChangesBot should call CosmeticChangesToolkit with the diff option disabled, as userPut will show the diff.
Change-Id: Ia44ca916e5aaaef08f9b4ea5ebcdcd24cddf3f08 --- M scripts/cosmetic_changes.py 1 file changed, 6 insertions(+), 4 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved XZise: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index f0c892d..a59b217 100755 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -79,6 +79,7 @@ import isbn from pywikibot import config, i18n, textlib, pagegenerators, Bot from pywikibot.page import url2unicode +from pywikibot.tools import deprecate_arg
warning = """ ATTENTION: You can run this script as a stand-alone for testing purposes. @@ -159,10 +160,11 @@
"""Cosmetic changes toolkit."""
- def __init__(self, site, debug=False, redirect=False, namespace=None, + @deprecate_arg('debug', 'diff') + def __init__(self, site, diff=False, redirect=False, namespace=None, pageTitle=None, ignore=CANCEL_ALL): self.site = site - self.debug = debug + self.diff = diff self.redirect = redirect self.namespace = namespace self.template = (self.namespace == 10) @@ -236,7 +238,7 @@ else: raise else: - if self.debug: + if self.diff: pywikibot.showDiff(text, new_text) return new_text
@@ -907,7 +909,7 @@ def treat(self, page): try: self.current_page = page - ccToolkit = CosmeticChangesToolkit(page.site, debug=True, + ccToolkit = CosmeticChangesToolkit(page.site, diff=False, namespace=page.namespace(), pageTitle=page.title(), ignore=self.getOption('ignore'))
pywikibot-commits@lists.wikimedia.org