jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/579306 )
Change subject: [doc] README.rst: recommended Python versions
......................................................................
[doc] README.rst: recommended Python versions
Change-Id: Id2d95178cea8e8946ba0b3db239764540ce95a84
---
M pywikibot/README.rst
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/README.rst b/pywikibot/README.rst
index 8d1cca2..6e46698 100644
--- a/pywikibot/README.rst
+++ b/pywikibot/README.rst
@@ -31,9 +31,9 @@
You need to have at least Python version `2.7.4 <http://www.python.org/download/>`_
or newer installed on your computer to be able to run any of the code in this
package, but not 3.0-3.3. Support for older versions of Python is not planned
-and version 2.7 may be dropped soon as well. It works fine with 3.4+ versions
-of Python installed. Please refer the manual at mediawiki for further details
-and restrictions.
+and versions 2.7 and 3.4 will be dropped soon as well. It works fine with 3.5+
+versions of Python installed. Please refer the manual at mediawiki for further
+details and restrictions.
You do not need to "install" this package to be able to make use of
--
To view, visit https://gerrit.wikimedia.org/r/579306
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: Id2d95178cea8e8946ba0b3db239764540ce95a84
Gerrit-Change-Number: 579306
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Zoranzoki21 <zorandori4444(a)gmail.com>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/578638 )
Change subject: [docs] Fix redirected link in README.rst
......................................................................
[docs] Fix redirected link in README.rst
Change-Id: Icba3da45c9a75e639ef3658530fd1ca19b5416b4
---
M README.rst
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README.rst b/README.rst
index 2e48732..97dcf97 100644
--- a/README.rst
+++ b/README.rst
@@ -82,7 +82,7 @@
------------
Our code is maintained on Wikimedia's `Gerrit installation <https://gerrit.wikimedia.org/>`_,
-`learn <https://www.mediawiki.org/wiki/Developer_access>`_ how to get
+`learn <https://www.mediawiki.org/wiki/Developer_account>`_ how to get
started.
.. include:: CODE_OF_CONDUCT.rst
--
To view, visit https://gerrit.wikimedia.org/r/578638
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: Icba3da45c9a75e639ef3658530fd1ca19b5416b4
Gerrit-Change-Number: 578638
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
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/578351 )
Change subject: [tests] Skip eventstreams test if eventstreams is not implemented for a family
......................................................................
[tests] Skip eventstreams test if eventstreams is not implemented for a family
Bug: T247251
Change-Id: I58b39c26314c0c7ecc7449e97e52aceab71b3f91
---
M tests/eventstreams_tests.py
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/eventstreams_tests.py b/tests/eventstreams_tests.py
index 01ec958..dc2c978 100644
--- a/tests/eventstreams_tests.py
+++ b/tests/eventstreams_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the eventstreams module."""
#
-# (C) Pywikibot team, 2017-2019
+# (C) Pywikibot team, 2017-2020
#
# Distributed under the terms of the MIT license.
#
@@ -301,8 +301,11 @@
ValueError 'Unterminated string' when json.load is processed
if the limit is high enough.
"""
+ try:
+ self.es = EventStreamsTestClass(streams='recentchange')
+ except NotImplementedError as e:
+ self.skipTest(e)
limit = 50
- self.es = EventStreamsTestClass(streams='recentchange')
self.es.set_maximum_items(limit)
self.assertLength(list(self.es), limit)
--
To view, visit https://gerrit.wikimedia.org/r/578351
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: I58b39c26314c0c7ecc7449e97e52aceab71b3f91
Gerrit-Change-Number: 578351
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
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/578339 )
Change subject: Localisation updates from https://translatewiki.net.
......................................................................
Localisation updates from https://translatewiki.net.
Change-Id: I18f28117f44b8654290881585cebff9e3ebf5574
---
M pywikibot/mk.json
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
L10n-bot: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/mk.json b/pywikibot/mk.json
index d4632d8..a68def8 100644
--- a/pywikibot/mk.json
+++ b/pywikibot/mk.json
@@ -11,8 +11,8 @@
"pywikibot-enter-new-text": "Внесете го новиот текст:",
"pywikibot-enter-page-processing": "Која страница треба да се обработи?",
"pywikibot-enter-xml-filename": "Внесете го името на XML-складот:",
- "pywikibot-fixes-fckeditor": "Робот: Исправка на збогатен HMTL",
- "pywikibot-fixes-html": "Робот: Претворање/исправка на HTML",
- "pywikibot-fixes-syntax": "Робот: Исправка на викисинтакса",
+ "pywikibot-fixes-fckeditor": "Бот: Исправка на збогатен HMTL",
+ "pywikibot-fixes-html": "Бот: Претворање/исправка на HTML",
+ "pywikibot-fixes-syntax": "Бот: Исправка на викисинтакса",
"pywikibot-touch": "Ништовно уредување со Pywikibot"
}
--
To view, visit https://gerrit.wikimedia.org/r/578339
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I18f28117f44b8654290881585cebff9e3ebf5574
Gerrit-Change-Number: 578339
Gerrit-PatchSet: 1
Gerrit-Owner: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/578072 )
Change subject: [IMPR] Install script dependencies all at once in tox.ini
......................................................................
[IMPR] Install script dependencies all at once in tox.ini
Change-Id: I15769f4ce62898c7f38066dc680a66d4b29ef90d
---
M setup.py
M tox.ini
2 files changed, 2 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/setup.py b/setup.py
index 2ef2645..44e59c2 100644
--- a/setup.py
+++ b/setup.py
@@ -96,6 +96,7 @@
script_deps['data_ingestion.py'] = extra_deps['csv']
extra_deps.update(script_deps)
+extra_deps.update({'scripts': [i for k, v in script_deps.items() for i in v]})
# ------- setup install_requires ------- #
# packages which are mandatory
diff --git a/tox.ini b/tox.ini
index ff5de6c..8a88118 100644
--- a/tox.ini
+++ b/tox.ini
@@ -36,6 +36,7 @@
fasttest: nose
fasttest: mock
+ fasttest: .[scripts]
fasttest-py27: nose-detecthttp
fasttest-py27: unicodecsv
--
To view, visit https://gerrit.wikimedia.org/r/578072
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: I15769f4ce62898c7f38066dc680a66d4b29ef90d
Gerrit-Change-Number: 578072
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
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/525056 )
Change subject: [FEAT] Add WikibaseEntity.editEntity and others
......................................................................
[FEAT] Add WikibaseEntity.editEntity and others
Change-Id: I6da98c6fbe48d41a61bd55c66112fce085d9cf23
---
M pywikibot/page.py
1 file changed, 53 insertions(+), 16 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index ed72160..7094040 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3798,6 +3798,33 @@
"""
return {}
+ def toJSON(self, diffto=None):
+ """
+ Create JSON suitable for Wikibase API.
+
+ When diffto is provided, JSON representing differences
+ to the provided data is created.
+
+ @param diffto: JSON containing entity data
+ @type diffto: dict
+
+ @rtype: dict
+ """
+ return {}
+
+ @classmethod
+ def _normalizeData(cls, data):
+ """
+ Helper function to expand data into the Wikibase API structure.
+
+ @param data: The dict to normalize
+ @type data: dict
+
+ @return: the altered dict from parameter data.
+ @rtype: dict
+ """
+ return {}
+
def exists(self):
"""
Determine if an entity exists in the data repository.
@@ -3840,6 +3867,28 @@
raise pywikibot.NoWikibaseEntity(self)
return {}
+ def editEntity(self, data=None, **kwargs):
+ """
+ Edit an entity using Wikibase wbeditentity API.
+
+ @param data: Data to be saved
+ @type data: dict, or None to save the current content of the entity.
+ """
+ if data is None:
+ data = self.toJSON(diffto=getattr(self, '_content', None))
+ else:
+ data = self._normalizeData(data)
+
+ updates = self.repo.editEntity(self, data, **kwargs)
+
+ # the attribute may have been unset in ItemPage
+ if getattr(self, 'id', '-1') == '-1':
+ self.__init__(self.repo, updates['entity']['id'])
+
+ self._content = updates['entity']
+ self.get()
+ return updates
+
def concept_uri(self):
"""
Return the full concept URI.
@@ -4229,6 +4278,7 @@
@return: the altered dict from parameter data.
@rtype: dict
"""
+ WikibaseEntity._normalizeData(data)
for prop in ('labels', 'descriptions'):
if prop not in data:
continue
@@ -4290,24 +4340,10 @@
else:
baserevid = None
- if data is None:
- data = self.toJSON(
- diffto=(self._content if hasattr(self, '_content') else None))
- else:
- data = WikibasePage._normalizeData(data)
-
- updates = self.repo.editEntity(self, data,
- baserevid=baserevid, **kwargs)
+ updates = super(WikibasePage, self).editEntity(
+ data, baserevid=baserevid, **kwargs)
self.latest_revision_id = updates['entity']['lastrevid']
- # todo: this variable is specific to ItemPage
- lazy_loading_id = not hasattr(self, 'id') and hasattr(self, '_site')
- if lazy_loading_id or self.id == '-1':
- self.__init__(self.site, title=updates['entity']['id'])
-
- self._content = updates['entity']
- self.get()
-
def editLabels(self, labels, **kwargs):
"""
Edit entity labels.
@@ -4794,6 +4830,7 @@
with a value for 'site' and 'title'.
"""
data = {}
+ # todo: move to _normalizeData
for obj in sitelinks:
if isinstance(obj, Page):
db_name = self.getdbName(obj.site)
--
To view, visit https://gerrit.wikimedia.org/r/525056
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: I6da98c6fbe48d41a61bd55c66112fce085d9cf23
Gerrit-Change-Number: 525056
Gerrit-PatchSet: 9
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <andre.costa(a)wikimedia.se>
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/578049 )
Change subject: [bugfix] endprefix parameter not working in Category.articles()
......................................................................
[bugfix] endprefix parameter not working in Category.articles()
The endprefix parameter should be used to set the value of
gcmendsortkeyprefix, rather than cmendsortkeyprefix.
Bug: T247201
Change-Id: Ieab2fa159d73e1e13656c9bc15470b4d5ba5ed55
---
M pywikibot/site.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 575b1e4..24a1d77 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4032,7 +4032,7 @@
if self.mw_version < '1.18':
raise NotImplementedError(
'categorymembers: "endprefix" requires MW 1.18+')
- cmargs['cmendsortkeyprefix'] = endprefix
+ cmargs['gcmendsortkeyprefix'] = endprefix
elif endprefix:
raise ValueError('categorymembers: '
"invalid combination of 'sortby' and 'endprefix'")
--
To view, visit https://gerrit.wikimedia.org/r/578049
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: Ieab2fa159d73e1e13656c9bc15470b4d5ba5ed55
Gerrit-Change-Number: 578049
Gerrit-PatchSet: 3
Gerrit-Owner: William Avery <willm.avery(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-CC: Welcome, new contributor! <ssethi(a)wikimedia.org>