jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/523712 )
Change subject: [bugfix] Don't try to import coordinates if they are not supported
......................................................................
[bugfix] Don't try to import coordinates if they are not supported
Otherwise an exception is raised.
Change-Id: Ib809bd575d32aacf44e4bf63285ec4cd4c104d03
---
M scripts/coordinate_import.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/coordinate_import.py b/scripts/coordinate_import.py
index 732ec11..ea4c46a 100755
--- a/scripts/coordinate_import.py
+++ b/scripts/coordinate_import.py
@@ -114,8 +114,9 @@
if page is None:
# running over items, search in linked pages
for page in item.iterlinks():
- if self.try_import_coordinates_from_page(page, item):
- break
+ if page.site.has_extension('GeoData'):
+ if self.try_import_coordinates_from_page(page, item):
+ break
return
self.try_import_coordinates_from_page(page, item)
--
To view, visit https://gerrit.wikimedia.org/r/523712
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib809bd575d32aacf44e4bf63285ec4cd4c104d03
Gerrit-Change-Number: 523712
Gerrit-PatchSet: 1
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/509767 )
Change subject: [tests] Remove 32-bit-tests for Python 2.7.4 and 3.4.1
......................................................................
[tests] Remove 32-bit-tests for Python 2.7.4 and 3.4.1
Currently all tests run on 32 bit and 64 bit environmets.
Python 2.7 and Python 3.4 runs for two releases both which
are 4 test for each. We can safely remove one of them to
get faster results.
Change-Id: Ice5d8faf31ac9f72772492441a9b2c2bdb500511
---
M .appveyor.yml
1 file changed, 0 insertions(+), 8 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml
index 73774f8..5eaf611 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -17,14 +17,6 @@
# Test the lowest supported release of each major Python version.
- - PYTHON: "C:\\Python274"
- PYTHON_VERSION: "2.7.4"
- PYTHON_ARCH: "32"
-
- - PYTHON: "C:\\Python341"
- PYTHON_VERSION: "3.4.1"
- PYTHON_ARCH: "32"
-
- PYTHON: "C:\\Python274-x64"
PYTHON_VERSION: "2.7.4"
PYTHON_ARCH: "64"
--
To view, visit https://gerrit.wikimedia.org/r/509767
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice5d8faf31ac9f72772492441a9b2c2bdb500511
Gerrit-Change-Number: 509767
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <Ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/523529 )
Change subject: refactor(config2): remove the unimplemented proxy variable
......................................................................
refactor(config2): remove the unimplemented proxy variable
Users can use environment variables to setup a proxy as mentioned in [1].
Users who already have this unused variable in their user-config.py file
will now recieve the following warning:
"""
UserWarning: Configuration variable "proxy" is defined in your \
user-config.py but unknown. It can be a misspelled one or a variable
that is no longer supported.
"""
[1]:
https://www.mediawiki.org/w/index.php?title=Manual:Pywikibot/Installation&d…
Bug: T111752
Change-Id: Ife62e94d13fc6c33e8a19a49bf855f26cbb49a65
---
M pywikibot/config2.py
1 file changed, 1 insertion(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index e8316a2..b405b79 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -108,7 +108,7 @@
# variables that are intended only for internal use and not to be exported
# to other modules.
-_private_values = {'authenticate', 'proxy', 'db_password'}
+_private_values = {'authenticate', 'db_password'}
_deprecated_variables = {'use_SSL_onlogin', 'use_SSL_always',
'available_ssl_project', 'fake_user_agent',
'special_page_limit'}
@@ -874,11 +874,6 @@
# ############# FURTHER SETTINGS ##############
-# Proxy configuration
-
-# TODO: proxy support
-proxy = None
-
# Simulate settings
# Defines what additional actions the bots are NOT allowed to do (e.g. 'edit')
--
To view, visit https://gerrit.wikimedia.org/r/523529
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ife62e94d13fc6c33e8a19a49bf855f26cbb49a65
Gerrit-Change-Number: 523529
Gerrit-PatchSet: 1
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/513753 )
Change subject: [cleanup] Use suggest_help to suggest help in transferbot.py
......................................................................
[cleanup] Use suggest_help to suggest help in transferbot.py
Use commonly used suggest_help instead of exception handling
Change-Id: Ie60c617d26696079c86560abcdab726f011568d4
---
M scripts/transferbot.py
1 file changed, 11 insertions(+), 45 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/transferbot.py b/scripts/transferbot.py
index da21cda..8bf29bf 100755
--- a/scripts/transferbot.py
+++ b/scripts/transferbot.py
@@ -47,40 +47,12 @@
from __future__ import absolute_import, division, unicode_literals
import pywikibot
+from pywikibot.bot import suggest_help
from pywikibot import pagegenerators
docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
-class WikiTransferException(Exception):
-
- """Base class for exceptions from this script.
-
- Makes it easier for clients to catch all expected exceptions that the
- script might throw
- """
-
- pass
-
-
-class TargetSiteMissing(WikiTransferException):
-
- """Thrown when the target site is the same as the source site.
-
- Based on the way each are initialized, this is likely to happen when the
- target site simply hasn't been specified.
- """
-
- pass
-
-
-class TargetPagesMissing(WikiTransferException):
-
- """Thrown if no page range has been specified to operate on."""
-
- pass
-
-
def main(*args):
"""
Process command line arguments and invoke bot.
@@ -114,13 +86,16 @@
elif arg == '-overwrite':
overwrite = True
- tosite = pywikibot.Site(tolang, tofamily)
- if fromsite == tosite:
- raise TargetSiteMissing('Target site not different from source site')
-
gen = gen_factory.getCombinedGenerator()
- if not gen:
- raise TargetPagesMissing('Target pages not specified')
+
+ tosite = pywikibot.Site(tolang, tofamily)
+ additional_text = ('Target site not different from source site.'
+ if fromsite == tosite else '')
+
+ if additional_text or not gen:
+ suggest_help(missing_generator=not gen,
+ additional_text=additional_text)
+ return
gen_args = ' '.join(gen_args)
pywikibot.output("""
@@ -180,13 +155,4 @@
if __name__ == '__main__':
- try:
- main()
- except TargetSiteMissing:
- pywikibot.error('Need to specify a target site and/or language')
- pywikibot.error('Try running this script with -help for help/usage')
- pywikibot.exception()
- except TargetPagesMissing:
- pywikibot.error('Need to specify a page range')
- pywikibot.error('Try running this script with -help for help/usage')
- pywikibot.exception()
+ main()
--
To view, visit https://gerrit.wikimedia.org/r/513753
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie60c617d26696079c86560abcdab726f011568d4
Gerrit-Change-Number: 513753
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/516620 )
Change subject: [cleanup] package name is shown by subTest already
......................................................................
[cleanup] package name is shown by subTest already
Change-Id: I4391a6f0146cca15f580af62c1c1741358e08041
---
M tests/l10n_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py
index 52bb522..9211923 100644
--- a/tests/l10n_tests.py
+++ b/tests/l10n_tests.py
@@ -111,8 +111,8 @@
for key in keys:
with self.subTest(package=package, key=key):
self.assertIn(key, languages,
- "'{}' - json key '{}' is not a site language"
- .format(package, key))
+ "json key '{}' is not a site language"
+ .format(key))
def setUpModule(): # noqa: N802
--
To view, visit https://gerrit.wikimedia.org/r/516620
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4391a6f0146cca15f580af62c1c1741358e08041
Gerrit-Change-Number: 516620
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/523169 )
Change subject: test(TestLoginLogout): mark as a user test
......................................................................
test(TestLoginLogout): mark as a user test
Also remove the initial login status check. RequireUserMixin
will login to the site automatically.
Bug: T228050
Change-Id: Idef0964eda365aaabd48433ee58aeb37f98ef296
---
M tests/site_tests.py
1 file changed, 2 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index e94296e..beed649 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -3660,17 +3660,13 @@
"""Test for login and logout methods."""
- @unittest.skipIf(os.environ.get('APPVEYOR', 'false') in ('true', 'True'),
- 'No user defined for APPVEYOR tests')
+ user = True
+
def test_login_logout(self):
"""Validate login and logout methods by toggling the state."""
site = self.get_site()
loginstatus = pywikibot.site.LoginStatus
- self.assertFalse(site.logged_in())
- self.assertEqual(site._loginstatus, loginstatus.NOT_ATTEMPTED)
-
- site.login()
self.assertTrue(site.logged_in())
self.assertIn(site._loginstatus, (loginstatus.IN_PROGRESS,
loginstatus.AS_USER))
--
To view, visit https://gerrit.wikimedia.org/r/523169
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idef0964eda365aaabd48433ee58aeb37f98ef296
Gerrit-Change-Number: 523169
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/522946 )
Change subject: [bugfix] Fix exception message in WikibasePage.get
......................................................................
[bugfix] Fix exception message in WikibasePage.get
Currently, it prints:
NotImplementedError: <class 'pywikibot.page.ItemPage'>.get does not ...
or similar. Just ItemPage.get is enought and nicer.
Change-Id: I516ace3da8c1b24ab02cf6e10f7d306aa5ed18e7
---
M pywikibot/page.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index f93dbd9..59964df 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3949,7 +3949,7 @@
if args or kwargs:
raise NotImplementedError(
'{0}.get does not implement var args: {1!r} and {2!r}'.format(
- self.__class__, args, kwargs))
+ self.__class__.__name__, args, kwargs))
lazy_loading_id = not hasattr(self, 'id') and hasattr(self, '_site')
if force or not hasattr(self, '_content'):
--
To view, visit https://gerrit.wikimedia.org/r/522946
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I516ace3da8c1b24ab02cf6e10f7d306aa5ed18e7
Gerrit-Change-Number: 522946
Gerrit-PatchSet: 1
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)