jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/584131 )
Change subject: [bugfix] Restore initialization of Claim.on_item
......................................................................
[bugfix] Restore initialization of Claim.on_item
It was accidentally dropped in Icbcc728c7. This patch is
just a duct tape. Eventually, this should be subject to
another refactoring.
Bug: T248746
Change-Id: I29ed37b23f3883f48ab0abd510faa47bb3e3cb91
---
M pywikibot/page/__init__.py
1 file changed, 30 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 4704b67..f2f6db8 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -3862,6 +3862,12 @@
return claims
+ def set_on_item(self, item):
+ """Set Claim.on_item attribute for all claims in this collection."""
+ for claims in self.values():
+ for claim in claims:
+ claim.on_item = item
+
class SiteLinkCollection(MutableMapping):
"""A structure holding SiteLinks for a Wikibase item."""
@@ -4439,6 +4445,10 @@
if 'pageid' in self._content:
self._pageid = self._content['pageid']
+ # xxx: this is ugly
+ if 'claims' in data:
+ self.claims.set_on_item(self)
+
return data
@property
@@ -5241,7 +5251,23 @@
self.qualifiers = OrderedDict()
self.target = None
self.snaktype = 'value'
- self.on_item = None # The item it's on
+ self._on_item = None # The item it's on
+
+ @property
+ def on_item(self):
+ """Return item this claim is attached to."""
+ return self._on_item
+
+ @on_item.setter
+ def on_item(self, item):
+ self._on_item = item
+ for values in self.qualifiers.values():
+ for qualifier in values:
+ qualifier.on_item = item
+ for source in self.sources:
+ for values in source.values():
+ for source in values:
+ source.on_item = item
def __repr__(self):
"""Return the representation string."""
@@ -5577,6 +5603,7 @@
self.on_item.latest_revision_id = data['pageinfo']['lastrevid']
for claim in claims:
claim.hash = data['reference']['hash']
+ claim.on_item = self.on_item
source = defaultdict(list)
for claim in claims:
claim.isReference = True
@@ -5618,6 +5645,7 @@
if self.on_item is not None:
data = self.repo.editQualifier(self, qualifier, **kwargs)
self.on_item.latest_revision_id = data['pageinfo']['lastrevid']
+ qualifier.on_item = self.on_item
qualifier.isQualifier = True
if qualifier.getID() in self.qualifiers:
self.qualifiers[qualifier.getID()].append(qualifier)
@@ -5644,6 +5672,7 @@
self.on_item.latest_revision_id = data['pageinfo']['lastrevid']
for qualifier in qualifiers:
self.qualifiers[qualifier.getID()].remove(qualifier)
+ qualifier.on_item = None
def target_equals(self, value):
"""
--
To view, visit https://gerrit.wikimedia.org/r/584131
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: I29ed37b23f3883f48ab0abd510faa47bb3e3cb91
Gerrit-Change-Number: 584131
Gerrit-PatchSet: 2
Gerrit-Owner: 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/584116 )
Change subject: [bugfix] Fix scripts/login.py with clientlogin using "rememberMe"
......................................................................
[bugfix] Fix scripts/login.py with clientlogin using "rememberMe"
scripts/login.py ends session after it finishes, which clears
login credentials without rememberme cookie. With action=login,
rememberme cookie was set automatically, but clientlogin needs
to include "rememberMe" specifically in the API query.
Change-Id: Ib1b84d8c6e8fea79feb4073265b4066f2d75222a
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 207b3ab..917011a 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -3126,6 +3126,7 @@
if self.action == 'clientlogin':
# clientlogin requires non-empty loginreturnurl
parameters['loginreturnurl'] = 'https://example.com'
+ parameters['rememberMe'] = '1'
# base login request
login_request = self.site._request(use_get=False,
--
To view, visit https://gerrit.wikimedia.org/r/584116
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: Ib1b84d8c6e8fea79feb4073265b4066f2d75222a
Gerrit-Change-Number: 584116
Gerrit-PatchSet: 6
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
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/584108 )
Change subject: [doc] Update current release
......................................................................
[doc] Update current release
Change-Id: I2fc20aaef2b7b79daba9c15bdaa4d376e82252e8
---
M docs/conf.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/conf.py b/docs/conf.py
index 96a494c..b54bfcd 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -71,7 +71,7 @@
# The short X.Y version.
version = '3.0'
# The full version, including alpha/beta/rc tags.
-release = '3.0.20200306'
+release = '3.0.20200326'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
--
To view, visit https://gerrit.wikimedia.org/r/584108
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: I2fc20aaef2b7b79daba9c15bdaa4d376e82252e8
Gerrit-Change-Number: 584108
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/584094 )
Change subject: [bugfix] Fix errors produced by clientlogin
......................................................................
[bugfix] Fix errors produced by clientlogin
- clientlogin has different set of responses from login, which makes
several assertions fail
Change-Id: I41bdd6020cd32d22e15610e5973ec0a62683bc6a
---
M pywikibot/login.py
M tests/api_tests.py
2 files changed, 6 insertions(+), 2 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/login.py b/pywikibot/login.py
index ef65e03..1b32a48 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -262,6 +262,7 @@
'Illegal': 'is invalid',
'readapidenied': 'does not have read permissions',
'Failed': 'does not have read permissions',
+ 'FAIL': 'does not have read permissions',
}
def login(self, retry=False, autocreate=False):
@@ -303,7 +304,7 @@
if error_code in self._api_error:
error_msg = 'Username "{}" {} on {}'.format(
self.login_name, self._api_error[error_code], self.site)
- if error_code == 'Failed':
+ if error_code in ('Failed', 'FAIL'):
error_msg += '\n.{}'.format(e.info)
raise NoUsername(error_msg)
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 11a2dc1..bd3b310 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -1026,7 +1026,10 @@
try:
error.assert_called_with('Login failed (readapidenied).')
except AssertionError: # MW version is older than 1.34.0-wmf.13
- error.assert_called_with('Login failed (Failed).')
+ try:
+ error.assert_called_with('Login failed (FAIL).')
+ except AssertionError: # MW version is older than 1.27
+ error.assert_called_with('Login failed (Failed).')
warning.assert_called_with(
'API error readapidenied: '
'You need read permission to use this module.')
--
To view, visit https://gerrit.wikimedia.org/r/584094
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: I41bdd6020cd32d22e15610e5973ec0a62683bc6a
Gerrit-Change-Number: 584094
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/584014 )
Change subject: [doc] Add a note about site and page move
......................................................................
[doc] Add a note about site and page move
Change-Id: I081478ba6b33021e4201e209b3e801ca9217f2d2
---
M HISTORY.rst
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index d17e43b..c6f2898 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,6 +4,12 @@
Current release
---------------
+* Bugfixes and improvements
+* Localisation updates
+
+3.0.20200326
+------------
+* site.py and page.py files were moved to their own folders and will be split in the future
* Refactor data attributes of Wikibase entities (T233406)
* Functions dealing with stars list are desupported and may be removed
* Use path's stem of script filename within pwb.py wrapper (T248372)
--
To view, visit https://gerrit.wikimedia.org/r/584014
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: I081478ba6b33021e4201e209b3e801ca9217f2d2
Gerrit-Change-Number: 584014
Gerrit-PatchSet: 2
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)