lists.wikimedia.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
List overview
Download
Pywikibot-commits
July 2015
----- 2024 -----
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
pywikibot-commits@lists.wikimedia.org
2 participants
224 discussions
Start a n
N
ew thread
[Gerrit] Only allow ipaddr 2.1.10+ - change (pywikibot/core)
by jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. Change subject: Only allow ipaddr 2.1.10+ ...................................................................... Only allow ipaddr 2.1.10+ Enable use-system-packages for Python 2.7 to test ipaddr Bug: T105443 Change-Id: Ia58d2c6715acc0d9207846e9f6da9005843a6869 --- M .travis.yml M pywikibot/tools/ip.py M requirements.txt M setup.py M tests/tools_ip_tests.py 5 files changed, 37 insertions(+), 13 deletions(-) Approvals: XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/.travis.yml b/.travis.yml index c8fb5c7..203d846 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ - djvulibre-bin - graphviz - liblua5.1-0-dev + - python-ipaddr before_install: # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the @@ -92,7 +93,7 @@ matrix: include: - - python: '2.7' + - python: '2.7_with_system_site_packages' # equivalent to virtualenv: system_site_packages: true env: LANGUAGE=he FAMILY=wikivoyage SITE_ONLY=1 - python: '2.7' env: LANGUAGE=wikia FAMILY=wikia PYWIKIBOT2_TEST_NO_RC=1 diff --git a/pywikibot/tools/ip.py b/pywikibot/tools/ip.py index 41a5f41..b50f8d5 100644 --- a/pywikibot/tools/ip.py +++ b/pywikibot/tools/ip.py @@ -14,24 +14,30 @@ import re import sys +from distutils.version import StrictVersion from warnings import warn from pywikibot.tools import DeprecatedRegex -ipaddress_e = ipaddr_e = None +_ipaddress_e = _ipaddr_e = _ipaddr_version = None try: from ipaddress import ip_address -except ImportError as ipaddress_e: +except ImportError as e: + _ipaddress_e = e ip_address = None - pass if not ip_address or sys.version_info[0] < 3: try: - from ipaddr import IPAddress as ip_address - ip_address.__T76286__ = False - except ImportError as ipaddr_e: - pass + from ipaddr import __version__ as _ipaddr_version + except ImportError as e: + _ipaddr_e = e + else: + _ipaddr_version = StrictVersion(_ipaddr_version) + if _ipaddr_version >= StrictVersion('2.1.10'): + from ipaddr import IPAddress as ip_address + else: + _ipaddr_e = ImportError('ipaddr %s is broken.' % _ipaddr_version) if ip_address and ip_address.__module__ == 'ipaddress': if sys.version_info[0] < 3: @@ -66,8 +72,8 @@ elif not ip_address: warn('Importing ipaddr.IPAddress failed: %s\n' 'Importing ipaddress.ip_address failed: %s\n' - 'Please install ipaddr.' - % (ipaddr_e, ipaddress_e), ImportWarning) + 'Please install ipaddr 2.1.10+ or ipaddress.' + % (_ipaddr_e, _ipaddress_e), ImportWarning) def ip_address_fake(IP): """Fake ip_address method.""" diff --git a/requirements.txt b/requirements.txt index e0f5a1f..7febc63 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,6 +31,9 @@ pyasn1 ; python_full_version < '2.7.9' future ; python_version < '2.7' + +ipaddr>=2.1.10 ; python_version < '3' + # core interwiki_graph.py:
git+https://github.com/nlhepler/pydot#egg=pydot-1.0.29
diff --git a/setup.py b/setup.py index c07fdbe..0e9dab9 100644 --- a/setup.py +++ b/setup.py @@ -92,7 +92,8 @@ # However the Debian package python-ipaddr is also supported: #
https://pypi.python.org/pypi/ipaddr
# Other backports are likely broken. - dependencies.append('ipaddr') + # ipaddr 2.1.10+ is distributed with Debian and Fedora. See T105443. + dependencies.append('ipaddr>=2.1.10') if sys.version_info < (2, 7, 9): # Python versions before 2.7.9 will cause urllib3 to trigger diff --git a/tests/tools_ip_tests.py b/tests/tools_ip_tests.py index 659b756..80cd776 100644 --- a/tests/tools_ip_tests.py +++ b/tests/tools_ip_tests.py @@ -9,6 +9,8 @@ __version__ = '$Id$' +from distutils.version import StrictVersion + from pywikibot.tools import ip from tests.aspects import unittest, TestCase, DeprecationTestCase @@ -69,8 +71,6 @@ self.ipv6test(True, "FF02:0000:0000:0000:0000:0000:0000:0001") self.ipv6test(True, "0000:0000:0000:0000:0000:0000:0000:0001") self.ipv6test(True, "0000:0000:0000:0000:0000:0000:0000:0000") - self.ipv6test(False, "02001:0000:1234:0000:0000:C1C0:ABCD:0876") # extra 0 not allowed! - self.ipv6test(False, "2001:0000:1234:0000:00001:C1C0:ABCD:0876") # extra 0 not allowed! self.ipv6test(False, " 2001:0000:1234:0000:0000:C1C0:ABCD:0876") # leading space self.ipv6test(False, "2001:0000:1234:0000:0000:C1C0:ABCD:0876 ") # trailing space # leading and trailing space @@ -631,6 +631,11 @@ self.ipv6test(False, "1111:2222:3333:4444:5555:6666:00.00.00.00") self.ipv6test(False, "1111:2222:3333:4444:5555:6666:000.000.000.000") + def _test_T105443_failures(self): + """Test known bugs with ipaddr v2.1.10.""" + self.ipv6test(False, "02001:0000:1234:0000:0000:C1C0:ABCD:0876") # extra 0 not allowed! + self.ipv6test(False, "2001:0000:1234:0000:00001:C1C0:ABCD:0876") # extra 0 not allowed! + class IPRegexTestCase(TestIPBase, DeprecationTestCase): @@ -643,6 +648,7 @@ """Test IP regex.""" self._run_tests() self._test_T76286_failures() + self._test_T105443_failures() self.assertEqual(self.fail, 0) self.assertDeprecation( 'page.ip_regexp is deprecated, use tools.ip.is_IP instead.') @@ -676,6 +682,13 @@ self._test_T76286_failures() self.assertEqual(self.fail, 0) + @expected_failure_if(ip.ip_address.__module__ == 'ipaddr' and + ip._ipaddr_version == StrictVersion('2.1.10')) + def test_T105443_failures(self): + """Test known bugs in the ipaddr module.""" + self._test_T105443_failures() + self.assertEqual(self.fail, 0) + if __name__ == "__main__": try: unittest.main() -- To view, visit
https://gerrit.wikimedia.org/r/224020
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ia58d2c6715acc0d9207846e9f6da9005843a6869 Gerrit-PatchSet: 8 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl> Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de> Gerrit-Reviewer: jenkins-bot <>
8 years, 8 months
1
0
0
0
Passed: wikimedia/pywikibot-core#2586 (master - b1310b8)
by Travis CI
Build Update for wikimedia/pywikibot-core ------------------------------------- Build: #2586 Status: Passed Duration: 25 minutes and 24 seconds Commit: b1310b8 (master) Author: Avicennasis Message: Commonscat l18n for Scots Wikipedia per T106932 Change-Id: Ica02b18e66115ec504f3b172b16785d1307ec28c View the changeset:
https://github.com/wikimedia/pywikibot-core/compare/dcf53aceb136...b1310b8c…
View the full build log and details:
https://travis-ci.org/wikimedia/pywikibot-core/builds/72812927
-- You can configure recipients for build notifications in your .travis.yml file. See
http://docs.travis-ci.com/user/notifications
8 years, 8 months
1
0
0
0
Broken: wikimedia/pywikibot-core#2585 (master - dcf53ac)
by Travis CI
Build Update for wikimedia/pywikibot-core ------------------------------------- Build: #2585 Status: Broken Duration: 26 minutes and 43 seconds Commit: dcf53ac (master) Author: Avicennasis Message: Sandbox l18n for Scots Wikipedia Change-Id: Ib24b943e23c7b22cee5ddfdb0aac0516608ea9ac View the changeset:
https://github.com/wikimedia/pywikibot-core/compare/3cc6ff0cf64d...dcf53ace…
View the full build log and details:
https://travis-ci.org/wikimedia/pywikibot-core/builds/72809795
-- You can configure recipients for build notifications in your .travis.yml file. See
http://docs.travis-ci.com/user/notifications
8 years, 8 months
1
0
0
0
[Gerrit] Commonscat l18n for Scots Wikipedia per T106932 - change (pywikibot/core)
by jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. Change subject: Commonscat l18n for Scots Wikipedia per T106932 ...................................................................... Commonscat l18n for Scots Wikipedia per T106932 Change-Id: Ica02b18e66115ec504f3b172b16785d1307ec28c --- M scripts/commonscat.py 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 55cd8c1..54be96b 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -130,6 +130,7 @@ 'os': (u'Commonscat', [u'Commons cat']), 'pt': (u'Commonscat', [u'Commons cat']), 'ro': (u'Commonscat', [u'Commons cat']), + 'sco': ('Commons category', ['Commonscat', 'Commons cat']), 'ru': (u'Commonscat', [u'Викисклад-кат', u'Commons category']), 'simple': (u'Commonscat', [u'Commons cat', u'Commons cat multi', u'Commons category', -- To view, visit
https://gerrit.wikimedia.org/r/227202
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ica02b18e66115ec504f3b172b16785d1307ec28c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Avicennasis <Avicennasis(a)gmail.com> Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl> Gerrit-Reviewer: Xqt <info(a)gno.de> Gerrit-Reviewer: jenkins-bot <>
8 years, 8 months
1
0
0
0
[Gerrit] Sandbox l18n for Scots Wikipedia - change (pywikibot/core)
by jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. Change subject: Sandbox l18n for Scots Wikipedia ...................................................................... Sandbox l18n for Scots Wikipedia Change-Id: Ib24b943e23c7b22cee5ddfdb0aac0516608ea9ac --- M scripts/clean_sandbox.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index 8f420b8..5df1da7 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -87,7 +87,7 @@ 'pt': u'<!--não apague esta linha-->{{página de testes}}<!--não apagar-->\r\n', 'ru': u'{{/Пишите ниже}}\n<!-- Не удаляйте, пожалуйста, эту строку, тестируйте ниже -->', 'simple': u'{{subst:/Text}}', - 'sco': u'Feel free tae test here', + 'sco': u'{{subst:Saundbox}}', 'sr': u'{{песак}}\n<!-- Молимо, испробавајте испод ове линије. Хвала. -->', 'sv': u'{{subst:Sandlådan}}', 'th': u'{{กระบะทราย}}\n<!-- กรุณาอย่าแก้ไขบรรทัดนี้ ขอบคุณครับ/ค่ะ -- ' @@ -124,7 +124,7 @@ 'pt': u'Project:Página de testes', 'ru': u'Project:Песочница', 'simple': u'Project:Sandbox', - 'sco': u'Project:Saundpit', + 'sco': u'Project:Saundbox', 'sr': u'Project:Песак', 'sv': u'Project:Sandlådan', 'th': u'Project:ทดลองเขียน', -- To view, visit
https://gerrit.wikimedia.org/r/227198
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ib24b943e23c7b22cee5ddfdb0aac0516608ea9ac Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Avicennasis <Avicennasis(a)gmail.com> Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl> Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de> Gerrit-Reviewer: jenkins-bot <>
8 years, 8 months
1
0
0
0
Passed: wikimedia/pywikibot-core#2584 (master - 3cc6ff0)
by Travis CI
Build Update for wikimedia/pywikibot-core ------------------------------------- Build: #2584 Status: Passed Duration: 28 minutes and 4 seconds Commit: 3cc6ff0 (master) Author: jenkins-bot Message: Merge "[COMPAT] Add pywikibot.verbose to compat2core script" View the changeset:
https://github.com/wikimedia/pywikibot-core/compare/e29d5600f5ae...3cc6ff0c…
View the full build log and details:
https://travis-ci.org/wikimedia/pywikibot-core/builds/72787271
-- You can configure recipients for build notifications in your .travis.yml file. See
http://docs.travis-ci.com/user/notifications
8 years, 8 months
1
0
0
0
[Gerrit] [COMPAT] Add pywikibot.verbose to compat2core script - change (pywikibot/core)
by jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. Change subject: [COMPAT] Add pywikibot.verbose to compat2core script ...................................................................... [COMPAT] Add pywikibot.verbose to compat2core script Change-Id: If0cf4a2a54ae19778065380db69c2c053d3e4f78 --- M scripts/maintenance/compat2core.py 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/maintenance/compat2core.py b/scripts/maintenance/compat2core.py index fb9ef6c..120ccef 100755 --- a/scripts/maintenance/compat2core.py +++ b/scripts/maintenance/compat2core.py @@ -23,7 +23,8 @@ pwb.py maintenance/compat2core <scriptname> -warnonly """ # -# (C) xqt, 2014 +# (C) xqt, 2014-2015 +# (C) Pywikibot team, 2014-2015 # # Distributed under the terms of the MIT license. # @@ -76,8 +77,9 @@ # other deprecated methods (r'(?<!site)\.encoding\s*\(\s*\)', '.site.encoding()'), (r'\.newimages\s*\(', '.newfiles('), - # new core methods + # new core methods and properties (r'\.get\s*\(\s*get_redirect\s*=\s*True\s*\)', '.text'), + (r'(?:pywikibot|wikipedia)\.verbose', 'config.verbose_output'), # stopme() is done by the framework itself (r'(\s*)try\:\s*\r?\n\s+main\(\)\s*\r?\n\s*finally\:\s*\r?\n' r'\s+pywikibot\.stopme\(\)', @@ -110,6 +112,8 @@ ('query.GetData(', 'query.GetData() should be replaced by pywikibot.data.api.Request or\n' 'by a direct site request'), + ('.verbose', + 'verbose_output need "from pywikibot import config" first') ) -- To view, visit
https://gerrit.wikimedia.org/r/226973
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged Gerrit-Change-Id: If0cf4a2a54ae19778065380db69c2c053d3e4f78 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt <info(a)gno.de> Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl> Gerrit-Reviewer: jenkins-bot <>
8 years, 8 months
1
0
0
0
Passed: wikimedia/pywikibot-core#2583 (master - e29d560)
by Travis CI
Build Update for wikimedia/pywikibot-core ------------------------------------- Build: #2583 Status: Passed Duration: 25 minutes and 52 seconds Commit: e29d560 (master) Author: jenkins-bot Message: Merge "[FEAT] scripts: Sensible error information" View the changeset:
https://github.com/wikimedia/pywikibot-core/compare/2933953571e6...e29d5600…
View the full build log and details:
https://travis-ci.org/wikimedia/pywikibot-core/builds/72679216
-- You can configure recipients for build notifications in your .travis.yml file. See
http://docs.travis-ci.com/user/notifications
8 years, 8 months
1
0
0
0
[Gerrit] [FEAT] scripts: Sensible error information - change (pywikibot/core)
by jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. Change subject: [FEAT] scripts: Sensible error information ...................................................................... [FEAT] scripts: Sensible error information Instead of just printing the help text, scripts now specifically tell what is wrong and don't print the help (just tell how to do it) so that the error message doesn't get overlooked in the wall of text. It additionally returns False if this occurs to make it possible for a caller of main() to differentiate between success and failure. If it was easy to add it also returns True if it could be run. Bug: T91575 Change-Id: I01dc24dc91825446d24a0eb28e563eb9ddb70e87 --- M pywikibot/bot.py M scripts/add_text.py M scripts/archivebot.py M scripts/basic.py M scripts/blockreview.py M scripts/capitalize_redirects.py M scripts/category.py M scripts/claimit.py M scripts/clean_sandbox.py M scripts/commons_link.py M scripts/commonscat.py M scripts/coordinate_import.py M scripts/cosmetic_changes.py M scripts/create_categories.py M scripts/data_ingestion.py M scripts/delete.py M scripts/disambredir.py M scripts/djvutext.py M scripts/featured.py M scripts/fixing_redirects.py M scripts/illustrate_wikidata.py M scripts/image.py M scripts/imagetransfer.py M scripts/imageuncat.py M scripts/isbn.py M scripts/listpages.py M scripts/login.py M scripts/makecat.py M scripts/match_images.py M scripts/movepages.py M scripts/newitem.py M scripts/noreferences.py M scripts/pagefromfile.py M scripts/piper.py M scripts/protect.py M scripts/redirect.py M scripts/reflinks.py M scripts/replace.py M scripts/script_wui.py M scripts/selflink.py M scripts/solve_disambiguation.py M scripts/spamremove.py M scripts/template.py M scripts/templatecount.py M scripts/touch.py M scripts/unlink.py M scripts/unusedfiles.py M scripts/weblinkchecker.py M scripts/welcome.py M tests/script_tests.py 50 files changed, 214 insertions(+), 120 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 2f85289..ec1c1de 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1249,6 +1249,44 @@ pywikibot.stdout(globalHelp) +def suggest_help(missing_parameters=[], missing_generator=False, + unknown_parameters=[], exception=None, + missing_action=False, additional_text=''): + """ + Output error message to use -help with additional text before it. + + @param missing_parameters: A list of parameters which are missing. + @type missing_parameters: list of str + @param missing_generator: Whether a generator is missing. + @type missing_generator: bool + @param unknown_parameters: A list of parameters which are unknown. + @type unknown_parameters: list of str + @param exception: An exception thrown. + @type exception: Exception + @param missing_action: Add an entry that no action was defined. + @type missing_action: bool + @param additional_text: Additional text added to the end. + @type additional_text: str + """ + if exception: + additional_text = ('An error occured: "{0}"'.format(exception) + + additional_text) + if missing_generator: + additional_text = ('Unable to execute script because no generator was ' + 'defined.\n' + additional_text) + if missing_parameters: + additional_text = 'Missing parameter(s) "{0}"\n'.format( + '", "'.join(missing_parameters)) + additional_text + if missing_action: + additional_text = 'No action defined.\n' + additional_text + if unknown_parameters: + additional_text = 'Unknown parameter(s) "{0}"\n'.format( + '", "'.join(unknown_parameters)) + additional_text + if not additional_text.endswith('\n'): + additional_text += '\n' + error(additional_text + 'Use -help for further information.') + + def writeToCommandLogFile(): """ Save name of the called module along with all parameters to logs/commands.log. diff --git a/scripts/add_text.py b/scripts/add_text.py index 7c03d85..b585321 100755 --- a/scripts/add_text.py +++ b/scripts/add_text.py @@ -340,8 +340,8 @@ addText = f.read() generator = genFactory.getCombinedGenerator() if not generator: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False if not addText: pywikibot.error("The text to add wasn't given.") return diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 37ca904..49bcf45 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -640,11 +640,8 @@ if calc: if not salt: - pywikibot.showHelp() - pywikibot.output( - 'NOTE: you must specify a salt to calculate a key using ' - '-salt:SALT option.') - return + pywikibot.bot.suggest_help(missing_parameters=['-salt']) + return False page = pywikibot.Page(site, calc) if page.exists(): calc = page.title() @@ -660,9 +657,8 @@ salt = '' if not args: - pywikibot.showHelp() - pywikibot.output(u'NOTE: you must specify a template to run the bot.') - return + pywikibot.bot.suggest_help(additional_text='No template was specified.') + return False for a in args: pagelist = [] diff --git a/scripts/basic.py b/scripts/basic.py index 7582c97..188c9a1 100755 --- a/scripts/basic.py +++ b/scripts/basic.py @@ -131,8 +131,10 @@ gen = pagegenerators.PreloadingGenerator(gen) bot = BasicBot(gen) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/blockreview.py b/scripts/blockreview.py index 47b40bf..6be52a9 100755 --- a/scripts/blockreview.py +++ b/scripts/blockreview.py @@ -303,17 +303,14 @@ @param args: command line arguments @type args: list of unicode """ - show = False - - # Parse command line arguments - if pywikibot.handle_args(args): - show = True - - if not show: + unknown_args = pywikibot.handle_args(args) + if unknown_args: + pywikibot.bot.suggest_help(unknown_parameters=unknown_args) + return False + else: bot = BlockreviewBot() bot.run() - else: - pywikibot.showHelp() + return True if __name__ == "__main__": main() diff --git a/scripts/capitalize_redirects.py b/scripts/capitalize_redirects.py index 82b93c0..3603041 100755 --- a/scripts/capitalize_redirects.py +++ b/scripts/capitalize_redirects.py @@ -120,8 +120,10 @@ preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = CapitalizeBot(preloadingGen, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/category.py b/scripts/category.py index ad4d119..587555c 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -1271,8 +1271,10 @@ finally: if catDB: catDB.dump() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_action=True) + return False if __name__ == "__main__": diff --git a/scripts/claimit.py b/scripts/claimit.py index 099d9a2..ef634fe 100755 --- a/scripts/claimit.py +++ b/scripts/claimit.py @@ -203,12 +203,12 @@ generator = gen.getCombinedGenerator() if not generator: - # show help text from the top of this file - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False bot = ClaimRobot(generator, claims, exists_arg) bot.run() + return True if __name__ == "__main__": main() diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py index b6d9824..46ed724 100755 --- a/scripts/clean_sandbox.py +++ b/scripts/clean_sandbox.py @@ -287,8 +287,13 @@ generator = gen_factory.getCombinedGenerator() - bot = SandboxBot(generator=generator, **opts) - bot.run() + if generator: + bot = SandboxBot(generator=generator, **opts) + bot.run() + return True + + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/commons_link.py b/scripts/commons_link.py index 17ed26f..3d1f974 100755 --- a/scripts/commons_link.py +++ b/scripts/commons_link.py @@ -132,14 +132,16 @@ else: genFactory.handleArg(arg) - if 'action' in options: - gen = genFactory.getCombinedGenerator() - if gen: - gen = pagegenerators.PreloadingGenerator(gen) - bot = CommonsLinkBot(gen, **options) - bot.run() - return - pywikibot.showHelp() + gen = genFactory.getCombinedGenerator() + if 'action' in options and gen: + gen = pagegenerators.PreloadingGenerator(gen) + bot = CommonsLinkBot(gen, **options) + bot.run() + return True + + pywikibot.bot.suggest_help(missing_action='action' not in options, + missing_generator=not gen) + return False if __name__ == "__main__": diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 2289005..55cd8c1 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -533,8 +533,10 @@ pregenerator = pagegenerators.PreloadingGenerator(generator) bot = CommonscatBot(pregenerator, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py index e7fb94c..3a63791 100755 --- a/scripts/coordinate_import.py +++ b/scripts/coordinate_import.py @@ -127,8 +127,10 @@ if generator: coordbot = CoordImportRobot(generator) coordbot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py index 3aff85f..de6afcf 100644 --- a/scripts/cosmetic_changes.py +++ b/scripts/cosmetic_changes.py @@ -135,8 +135,10 @@ preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = CosmeticChangesBot(preloadingGen, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/create_categories.py b/scripts/create_categories.py index a133c80..3f4c3ac 100755 --- a/scripts/create_categories.py +++ b/scripts/create_categories.py @@ -107,14 +107,22 @@ else: genFactory.handleArg(arg) + missing = set() + if not parent: + missing.add('-parent') + if not basename: + missing.add('-basename') + generator = genFactory.getCombinedGenerator() - if generator and parent and basename: + if generator and missing: bot = CreateCategoriesBot(generator, parent, basename, **options) bot.run() - pywikibot.output(u'All done') + pywikibot.output('All done') + return True else: - pywikibot.output(u'No pages to work on') - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=missing, + missing_generator=not generator) + return False if __name__ == "__main__": main() diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py index 14faa89..b79f447 100755 --- a/scripts/data_ingestion.py +++ b/scripts/data_ingestion.py @@ -271,8 +271,10 @@ config_generator = genFactory.getCombinedGenerator() if not config_generator or not csv_dir: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help( + missing_parameters=[] if csv_dir else ['-csvdir'], + missing_generator=not config_generator) + return False for config_page in config_generator: try: diff --git a/scripts/delete.py b/scripts/delete.py index 0391072..41af4fa 100755 --- a/scripts/delete.py +++ b/scripts/delete.py @@ -156,9 +156,10 @@ % ['', 'un'][options.get('undelete', False)]) bot = DeletionRobot(generator, summary, **options) bot.run() + return True else: - # Show help text from the top of this file - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": diff --git a/scripts/disambredir.py b/scripts/disambredir.py index 2d1ac32..50bed26 100755 --- a/scripts/disambredir.py +++ b/scripts/disambredir.py @@ -75,9 +75,8 @@ try: mysite.disambcategory() except pywikibot.Error as e: - pywikibot.output(e) - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(exception=e) + return False generator = pagegenerators.CategorizedPageGenerator( mysite.disambcategory(), start=start, content=True, namespaces=[0]) diff --git a/scripts/djvutext.py b/scripts/djvutext.py index 688b19a..b72b0b7 100644 --- a/scripts/djvutext.py +++ b/scripts/djvutext.py @@ -158,7 +158,7 @@ # index is mandatory. if not index: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=['-index']) return False # If djvu_path is not a fle, build djvu_path from dir+index. diff --git a/scripts/featured.py b/scripts/featured.py index 9e534b7..08bf8f9 100755 --- a/scripts/featured.py +++ b/scripts/featured.py @@ -627,11 +627,8 @@ else: options[arg[1:].lower()] = True - if options: - bot = FeaturedBot(**options) - bot.run() - else: - pywikibot.showHelp() + bot = FeaturedBot(**options) + bot.run() if __name__ == "__main__": diff --git a/scripts/fixing_redirects.py b/scripts/fixing_redirects.py index 78821f2..b922626 100755 --- a/scripts/fixing_redirects.py +++ b/scripts/fixing_redirects.py @@ -141,8 +141,10 @@ if gen: for page in pagegenerators.PreloadingGenerator(gen): workon(page) + return True else: - pywikibot.showHelp('fixing_redirects') + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/illustrate_wikidata.py b/scripts/illustrate_wikidata.py index cc1e4e2..7a3bd60 100755 --- a/scripts/illustrate_wikidata.py +++ b/scripts/illustrate_wikidata.py @@ -116,11 +116,12 @@ generator = generator_factory.getCombinedGenerator() if not generator: - pywikibot.output('I need a generator with pages to work on') - return + pywikibot.bot.suggest_help(missing_generator=True) + return False bot = IllustrateRobot(generator, wdproperty) bot.run() + return True if __name__ == "__main__": main() diff --git a/scripts/image.py b/scripts/image.py index d7b61a2..b6038a3 100755 --- a/scripts/image.py +++ b/scripts/image.py @@ -205,8 +205,10 @@ preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = ImageRobot(preloadingGen, old_image, new_image, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=['old image']) + return False if __name__ == "__main__": main() diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py index c88d07e..8f4329f 100755 --- a/scripts/imagetransfer.py +++ b/scripts/imagetransfer.py @@ -338,8 +338,8 @@ page = pywikibot.Page(pywikibot.Site(), pageTitle) gen = iter([page]) else: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_parameters=['page']) + return False if not targetLang and not targetFamily: targetSite = pywikibot.Site('commons', 'commons') diff --git a/scripts/imageuncat.py b/scripts/imageuncat.py index 85a6d7e..85a8bfc 100755 --- a/scripts/imageuncat.py +++ b/scripts/imageuncat.py @@ -1377,8 +1377,8 @@ generator = genFactory.getCombinedGenerator(gen=generator) if not generator: - pywikibot.output( - u'You have to specify the generator you want to use for the program!') + pywikibot.bot.suggest_help(missing_generator=True) + return False else: pregenerator = pagegenerators.PreloadingGenerator(generator) site.login() @@ -1388,6 +1388,7 @@ and (not page.isRedirectPage()): if isUncat(page): addUncat(page) + return True if __name__ == "__main__": main() diff --git a/scripts/isbn.py b/scripts/isbn.py index b5357d1..170c43c 100755 --- a/scripts/isbn.py +++ b/scripts/isbn.py @@ -1650,8 +1650,10 @@ else: bot = IsbnBot(preloadingGen, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/listpages.py b/scripts/listpages.py index c89be5a..9153d99 100755 --- a/scripts/listpages.py +++ b/scripts/listpages.py @@ -232,8 +232,10 @@ with open(filename, mode='wb') as f: f.write(page.text.encode(encoding)) pywikibot.output(u"%i page(s) found" % i) + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": diff --git a/scripts/login.py b/scripts/login.py index 1e87a4e..43271e3 100755 --- a/scripts/login.py +++ b/scripts/login.py @@ -76,6 +76,7 @@ sysop = False logall = False logout = False + unknown_args = [] for arg in pywikibot.handle_args(args): if arg.startswith("-pass"): if len(arg) == 5: @@ -94,8 +95,12 @@ elif arg == "-logout": logout = True else: - pywikibot.showHelp('login') - return + unknown_args += [arg] + + if unknown_args: + pywikibot.bot.suggest_help(unknown_parameters=unknown_args) + return False + if logall: if sysop: namedict = config.sysopnames diff --git a/scripts/makecat.py b/scripts/makecat.py index ded4a20..47b652e 100755 --- a/scripts/makecat.py +++ b/scripts/makecat.py @@ -204,7 +204,7 @@ workingcatname = arg if not workingcatname: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=['working category']) sys.exit(0) mysite = pywikibot.Site() diff --git a/scripts/match_images.py b/scripts/match_images.py index d74b715..cabef37 100755 --- a/scripts/match_images.py +++ b/scripts/match_images.py @@ -164,12 +164,10 @@ images.append(arg) if len(images) != 2: - pywikibot.showHelp('match_images') - pywikibot.error('Require two images to work on.') - return - - else: - pass + pywikibot.bot.suggest_help( + additional_text='Unable to execute script because it ' + 'requires two images to work on.') + return False imagePageA = pywikibot.page.FilePage(pywikibot.Site(), images[0]) diff --git a/scripts/movepages.py b/scripts/movepages.py index a27837a..1b72afa 100755 --- a/scripts/movepages.py +++ b/scripts/movepages.py @@ -270,8 +270,11 @@ preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = MovePagesBot(preloadingGen, **options) bot.run() - elif not fromToPairs: - pywikibot.showHelp() + return True + else: + # in theory pairs could be missing too + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == '__main__': main() diff --git a/scripts/newitem.py b/scripts/newitem.py index fcf3873..e2e1783 100755 --- a/scripts/newitem.py +++ b/scripts/newitem.py @@ -144,11 +144,12 @@ generator = gen.getCombinedGenerator() if not generator: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False bot = NewItemRobot(generator, **options) bot.run() + return True if __name__ == "__main__": main() diff --git a/scripts/noreferences.py b/scripts/noreferences.py index 11f03b0..6fb6204 100755 --- a/scripts/noreferences.py +++ b/scripts/noreferences.py @@ -735,8 +735,10 @@ if gen: bot = NoReferencesBot(gen, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": main() diff --git a/scripts/pagefromfile.py b/scripts/pagefromfile.py index 209355a..98d2ea6 100755 --- a/scripts/pagefromfile.py +++ b/scripts/pagefromfile.py @@ -317,7 +317,8 @@ # show help text from the top of this file if reader failed # or User quit. if failed_filename: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=['-file']) + return False else: reader = PageFromFileReader(filename, pageStartMarker, pageEndMarker, titleStartMarker, titleEndMarker, include, diff --git a/scripts/piper.py b/scripts/piper.py index a7af13d..f5d04eb 100755 --- a/scripts/piper.py +++ b/scripts/piper.py @@ -146,8 +146,10 @@ gen = pagegenerators.PreloadingGenerator(gen) bot = PiperBot(gen, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == '__main__': diff --git a/scripts/protect.py b/scripts/protect.py index 750c1cf..c7f4b98 100755 --- a/scripts/protect.py +++ b/scripts/protect.py @@ -250,9 +250,10 @@ u'Enter a reason for the protection change:') bot = ProtectionRobot(generator, combined_protections, site, **options) bot.run() + return True else: - # Show help text from the top of this file - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == '__main__': diff --git a/scripts/redirect.py b/scripts/redirect.py index e2b53ad..93f2b55 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -775,7 +775,13 @@ xmlFilename and moved_pages or fullscan and xmlFilename ): - pywikibot.showHelp() + problems = [] + if xmlFilename and moved_pages: + problems += ['Either use a XML file or the moved pages from the API'] + if xmlFilename and fullscan: + problems += ['Either use a XML file or do a full scan using the API'] + pywikibot.bot.suggest_help(additional_text='\n'.join(problems), + missing_action=not action) else: pywikibot.Site().login() gen = RedirectGenerator(xmlFilename, namespaces, offset, moved_pages, diff --git a/scripts/reflinks.py b/scripts/reflinks.py index 197c445..28efd97 100755 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -838,13 +838,14 @@ if not generator: generator = genFactory.getCombinedGenerator() if not generator: - # syntax error, show help text from the top of this file - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False + generator = pagegenerators.PreloadingGenerator(generator, step=50) generator = pagegenerators.RedirectFilterPageGenerator(generator) bot = ReferencesRobot(generator, **options) bot.run() + return True if __name__ == "__main__": main() diff --git a/scripts/replace.py b/scripts/replace.py index 31188d8..9a7f650 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -950,9 +950,8 @@ gen = genFactory.getCombinedGenerator(gen) if not gen: - # syntax error, show help text from the top of this file - pywikibot.showHelp('replace') - return + pywikibot.bot.suggest_help(missing_generator=True) + return False preloadingGen = pagegenerators.PreloadingGenerator(gen) bot = ReplaceRobot(preloadingGen, replacements, exceptions, acceptall, diff --git a/scripts/script_wui.py b/scripts/script_wui.py index aa87b53..daf7572 100755 --- a/scripts/script_wui.py +++ b/scripts/script_wui.py @@ -306,9 +306,10 @@ """ global __simulate, __sys_argv - for arg in pywikibot.handle_args(args): - pywikibot.showHelp('script_wui') - return + unknown_args = pywikibot.handle_args(args) + if unknown_args: + pywikibot.bot.suggest_help(unknown_parameters=unknown_args) + return False __simulate = pywikibot.config.simulate __sys_argv = sys.argv diff --git a/scripts/selflink.py b/scripts/selflink.py index 9502e8a..144dc3a 100755 --- a/scripts/selflink.py +++ b/scripts/selflink.py @@ -98,12 +98,13 @@ gen = genFactory.getCombinedGenerator() if not gen: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False preloadingGen = PreloadingGenerator(gen) bot = SelflinkBot(preloadingGen, **botArgs) bot.run() + return True if __name__ == "__main__": main() diff --git a/scripts/solve_disambiguation.py b/scripts/solve_disambiguation.py index 447f012..275b21c 100755 --- a/scripts/solve_disambiguation.py +++ b/scripts/solve_disambiguation.py @@ -1153,8 +1153,8 @@ generator = iter([page]) if not generator: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_generator=True) + return False site.login() diff --git a/scripts/spamremove.py b/scripts/spamremove.py index c728e9b..269deb0 100755 --- a/scripts/spamremove.py +++ b/scripts/spamremove.py @@ -62,9 +62,8 @@ spamSite = arg if not spamSite: - pywikibot.showHelp() - pywikibot.output(u"No spam site specified.") - return + pywikibot.bot.suggest_help(missing_parameters=['spam site']) + return False mysite = pywikibot.Site() pages = mysite.exturlusage(spamSite, namespaces=namespaces, content=True) diff --git a/scripts/template.py b/scripts/template.py index 3cec5d9..c8d0810 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -323,8 +323,8 @@ templateNames.append(templateName.title(withNamespace=False)) if not templateNames: - pywikibot.showHelp() - return + pywikibot.bot.suggest_help(missing_parameters=['templates']) + return False if options.get('subst', False) ^ options.get('remove', False): for templateName in templateNames: diff --git a/scripts/templatecount.py b/scripts/templatecount.py index f875627..b7d2c42 100755 --- a/scripts/templatecount.py +++ b/scripts/templatecount.py @@ -133,8 +133,8 @@ argsList.append(arg) if not operation: - pywikibot.showHelp('templatecount') - return + pywikibot.bot.suggest_help(missing_parameters=['operation']) + return False robot = TemplateCountRobot() if not argsList: diff --git a/scripts/touch.py b/scripts/touch.py index 20dad4c..fb1031c 100755 --- a/scripts/touch.py +++ b/scripts/touch.py @@ -96,8 +96,10 @@ bot = bot_class(generator=preloadingGen, **options) pywikibot.Site().login() bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": diff --git a/scripts/unlink.py b/scripts/unlink.py index 6672217..6baf5ad 100755 --- a/scripts/unlink.py +++ b/scripts/unlink.py @@ -166,8 +166,10 @@ page = pywikibot.Page(pywikibot.Site(), page_title) bot = UnlinkBot(page, **options) bot.run() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_parameters=['page title']) + return False if __name__ == "__main__": main() diff --git a/scripts/unusedfiles.py b/scripts/unusedfiles.py index 1db7922..36bd97a 100755 --- a/scripts/unusedfiles.py +++ b/scripts/unusedfiles.py @@ -123,8 +123,10 @@ try: bot.run() except pywikibot.Error as e: - pywikibot.showHelp() - pywikibot.warning(e) + pywikibot.bot.suggest_help(exception=e) + return False + else: + return True if __name__ == "__main__": diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index e3c8caf..2ccd232 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -938,8 +938,10 @@ bot.history.reportThread.kill() pywikibot.output(u'Saving history...') bot.history.save() + return True else: - pywikibot.showHelp() + pywikibot.bot.suggest_help(missing_generator=True) + return False if __name__ == "__main__": diff --git a/scripts/welcome.py b/scripts/welcome.py index b77d9e2..cd82b74 100755 --- a/scripts/welcome.py +++ b/scripts/welcome.py @@ -992,9 +992,8 @@ bot = WelcomeBot() except KeyError as error: # site not managed by welcome.py - pywikibot.showHelp() - pywikibot.warning(error) - return + pywikibot.bot.suggest_help(exception=error) + return False try: bot.run() diff --git a/tests/script_tests.py b/tests/script_tests.py index f7938cd..cdbdf87 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -102,6 +102,7 @@ 'checkimages', 'clean_sandbox', 'disambredir', + 'featured', 'imagerecat', 'login', 'lonelypages', @@ -123,25 +124,20 @@ # Some of these are not pretty, but at least they are informative # and not backtraces starting deep in the pywikibot package. no_args_expected_results = { - 'archivebot': 'NOTE: you must specify a template to run the bot', - 'create_categories': 'No pages to work on', # TODO: until done here, remember to set editor = None in user_config.py 'editarticle': 'Nothing changed', # This masks related bug 68645 but that # bug is more broadly about config # rather than editarticle. 'freebasemappingupload': 'Cannot find ', 'harvest_template': 'ERROR: Please specify', - 'illustrate_wikidata': 'I need a generator with pages to work on', 'imageuncat': 'WARNING: This script is primarily written for Wikimedia Commons', # script_input['interwiki'] above lists a title that should not exist 'interwiki': 'does not exist. Skipping.', 'login': 'Logged in on ', - 'match_images': 'Require two images to work on.', 'pagefromfile': 'Please enter the file name', 'replace': 'Press Enter to use this automatic message', 'script_wui': 'Pre-loading all relevant page contents', 'shell': ('>>> ', 'Welcome to the'), - 'spamremove': 'No spam site specified', 'transferbot': 'Target site not different from source site', # Bug 68662 'unusedfiles': ('Working on', None), 'watchlist': 'Retrieving watchlist', @@ -273,9 +269,13 @@ elif not is_autorun: if stderr_other == ['']: stderr_other = None - self.assertIsNone(stderr_other) - self.assertIn('Global arguments available for all', - result['stdout']) + if stderr_other is not None: + self.assertIn('Use -help for further information.', + stderr_other) + self.assertNotIn('-help', args) + else: + self.assertIn('Global arguments available for all', + result['stdout']) exit_codes = [0] else: -- To view, visit
https://gerrit.wikimedia.org/r/194542
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I01dc24dc91825446d24a0eb28e563eb9ddb70e87 Gerrit-PatchSet: 6 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de> Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com> Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl> Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de> Gerrit-Reviewer: Xqt <info(a)gno.de> Gerrit-Reviewer: jenkins-bot <>
8 years, 8 months
1
0
0
0
Fixed: wikimedia/pywikibot-core#2582 (master - 2933953)
by Travis CI
Build Update for wikimedia/pywikibot-core ------------------------------------- Build: #2582 Status: Fixed Duration: 27 minutes and 35 seconds Commit: 2933953 (master) Author: jenkins-bot Message: Merge "[IMPROV] docs: rewrite docstring fixups" View the changeset:
https://github.com/wikimedia/pywikibot-core/compare/576cad97a6ce...29339535…
View the full build log and details:
https://travis-ci.org/wikimedia/pywikibot-core/builds/72577902
-- You can configure recipients for build notifications in your .travis.yml file. See
http://docs.travis-ci.com/user/notifications
8 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200