jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/509395 )
Change subject: [L10N] Add testwiki and improve errors in clean_sandbox.py ......................................................................
[L10N] Add testwiki and improve errors in clean_sandbox.py
- Merge pywikibot.error with raise as the error message can be overlooked - Remove traceback for missing generator
Bug: T217054 Change-Id: I5f5b83e9ed6ee7186eee7463e76cceb2770c846f --- M scripts/clean_sandbox.py 1 file changed, 6 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index ecc9d2b..36c27f7 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -38,6 +38,7 @@ from __future__ import absolute_import, division, unicode_literals
import datetime +import sys import time
import pywikibot @@ -46,6 +47,8 @@
content = { 'commons': '{{Sandbox}}\n<!-- Please edit only below this line. -->', + 'test': '<noinclude>{{Sandbox}}</noinclude>\n' + '== Please start your testing below this line ==', 'wikidata': '{{Please leave this line alone (sandbox heading)}}', 'wikivoyage': { 'es': '<!--No borres este mensaje-->' @@ -155,8 +158,8 @@ self.translated_content = self.getOption('text') or i18n.translate( self.site, content) if not self.translated_content: - pywikibot.error('No content is given for pages, exiting.') - raise RuntimeError + raise RuntimeError( + 'No content is given for sandbox pages, exiting.') if not self.generator: pages = [] for item in sandbox_titles: @@ -165,7 +168,7 @@ pages.append(p) if not pages: pywikibot.bot.suggest_help(missing_generator=True) - raise RuntimeError + sys.exit() self.generator = pages
def run(self):