jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/339905 )
Change subject: wikisourcetext.py: remove misleading -force and -showdiff ......................................................................
wikisourcetext.py: remove misleading -force and -showdiff
Remove -force and -showdiff. It is not possible to preload text if a page is already existing. The latest text is loaded anyhow, so when trying to override, nothing will happen.
Change-Id: Ia93c945a57c11bf7a0e99284629461d357b99c66 --- M scripts/wikisourcetext.py 1 file changed, 7 insertions(+), 13 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/scripts/wikisourcetext.py b/scripts/wikisourcetext.py index 2dd0e45..de5f154 100644 --- a/scripts/wikisourcetext.py +++ b/scripts/wikisourcetext.py @@ -22,19 +22,14 @@ A -> just page A -B -> pages 1 until B
- -showdiff show difference before old and new text before saving. - -summary: custom edit summary. Use quotes if edit summary contains spaces. - - -force overwrites existing text - optional, default False
-always don't bother asking to confirm any of the changes.
""" # -# (C) Pywikibot team, 2016 +# (C) Pywikibot team, 2016-2017 # # Distributed under the terms of the MIT license. # @@ -50,6 +45,7 @@
from pywikibot.bot import SingleSiteBot from pywikibot.proofreadpage import IndexPage +from pywikibot.tools import issue_deprecation_warning
class UploadTextBot(SingleSiteBot): @@ -58,7 +54,7 @@ A bot that uploads text-layer to Page:namespace.
Text is fetched via preload as on Wikisource wikis, text can be preloaded - even if a page does not exist, if an Index page is present. + only if a page does not exist, if an Index page is present.
Works only on sites with Proofread Page extension installed. """ @@ -71,9 +67,7 @@ @type generator: generator """ self.availableOptions.update({ - 'force': False, - 'showdiff': False, - 'summary': 'Uploading text' + 'summary': 'Bot: uploading text' }) super(UploadTextBot, self).__init__(**kwargs) self.generator = generator @@ -90,7 +84,7 @@ new_text = page.text
summary = self.getOption('summary') - if page.exists() and not self.getOption('force'): + if page.exists(): pywikibot.output('Page %s already exists, not adding!' % page) else: self.userPut(page, old_text, new_text, @@ -120,11 +114,11 @@ elif arg == '-pages': pages = value elif arg == '-showdiff': - options['showdiff'] = True + issue_deprecation_warning('The usage of -showdiff option', None, 0) elif arg == '-summary': options['summary'] = value elif arg == '-force': - options['force'] = True + issue_deprecation_warning('The usage of -force option', None, 0) elif arg == '-always': options['always'] = True else:
pywikibot-commits@lists.wikimedia.org