jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/281632 )
Change subject: Deprecate site.has_transcluded_data
......................................................................
Deprecate site.has_transcluded_data
Since Wikidata was deployed to all sites and r11188 [1] was merged
there is no difference between has_transcluded_data and has_data_repository
property. Deprecate the first one and replace them in framework's scripts.
Also change some doc strings related to that including test.
[1] https://mediawiki.org/wiki/Special:Code/pywikipedia/11188
Change-Id: If898bb5721ce5b29b73b8af5f81e2574242cb501
---
M pywikibot/page.py
M pywikibot/site.py
M scripts/interwiki.py
M tests/aspects.py
M tests/wikibase_tests.py
5 files changed, 14 insertions(+), 13 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 586e907..147cde2 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -12,7 +12,7 @@
"""
#
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
@@ -3974,9 +3974,9 @@
@raise NoPage: There is no corresponding ItemPage for the page
"""
- if not page.site.has_transcluded_data:
- raise pywikibot.WikiBaseError(u'%s has no transcluded data'
- % page.site)
+ if not page.site.has_data_repository:
+ raise pywikibot.WikiBaseError('{0} has no data repository'
+ ''.format(page.site))
if not lazy_load and not page.exists():
raise pywikibot.NoPage(page)
diff --git a/pywikibot/site.py b/pywikibot/site.py
index f2724d9..19ba432 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -6,7 +6,7 @@
groups of wikis on the same topic in different languages.
"""
#
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
@@ -2742,9 +2742,10 @@
return self.data_repository() is not None
@property
+ @deprecated('has_data_repository')
def has_transcluded_data(self):
"""Return True if site has a shared data repository like Wikidata."""
- return self.data_repository() is not None
+ return self.has_data_repository
def image_repository(self):
"""Return Site object for image repository e.g. commons."""
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index baf0c5a..513dd5b 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -336,7 +336,7 @@
# (C) Rob W.W. Hooft, 2003
# (C) Daniel Herding, 2004
# (C) Yuri Astrakhan, 2005-2006
-# (C) xqt, 2009-2014
+# (C) xqt, 2009-2017
# (C) Pywikibot team, 2007-2017
#
# Distributed under the terms of the MIT license.
@@ -1732,7 +1732,7 @@
# if we have an account for this site
if site.family.name in config.usernames and \
site.code in config.usernames[site.family.name] and \
- not site.has_transcluded_data:
+ not site.has_data_repository:
# Try to do the changes
try:
if self.replaceLinks(page, new):
diff --git a/tests/aspects.py b/tests/aspects.py
index 993f9cd..edc4817 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1343,14 +1343,14 @@
Set up the test class.
Checks that all sites are configured as a Wikibase client,
- with Site.has_transcluded_data() returning True.
+ with Site.has_data_repository returning True.
"""
super(WikibaseClientTestCase, cls).setUpClass()
for site in cls.sites.values():
- if not site['site'].has_transcluded_data:
+ if not site['site'].has_data_repository:
raise unittest.SkipTest(
- u'%s: %r does not have transcluded data'
+ '%s: %r does not have data repository'
% (cls.__name__, site['site']))
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 0aaad45..b00817b 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Tests for the Wikidata parts of the page module."""
#
-# (C) Pywikibot team, 2008-2016
+# (C) Pywikibot team, 2008-2017
#
# Distributed under the terms of the MIT license.
#
@@ -1234,7 +1234,7 @@
self.assertRaises(pywikibot.WikiBaseError,
ItemPage.fromPage, self.wdp)
self.assertRaisesRegex(pywikibot.WikiBaseError,
- 'no transcluded data',
+ 'no data repository',
self.wdp.data_item)
--
To view, visit https://gerrit.wikimedia.org/r/281632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If898bb5721ce5b29b73b8af5f81e2574242cb501
Gerrit-PatchSet: 7
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/338617 )
Change subject: Make PropertyPage.get() return a dictionary
......................................................................
Make PropertyPage.get() return a dictionary
This is consistent with the parent method and ItemPage.get() do.
This shouldn't be a breaking change, I believe.
Change-Id: Icf0bff007b6d44efe000cdab3a565f19d0bd4a2c
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/page.py b/pywikibot/page.py
index c401000..1f61088 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4349,9 +4349,10 @@
raise NotImplementedError(
'PropertyPage.get only implements "force".')
- if force or not hasattr(self, '_content'):
- WikibasePage.get(self, force)
+ data = WikibasePage.get(self, force)
self._type = self._content['datatype']
+ data['datatype'] = self._content['datatype']
+ return data
def newClaim(self, *args, **kwargs):
"""
--
To view, visit https://gerrit.wikimedia.org/r/338617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icf0bff007b6d44efe000cdab3a565f19d0bd4a2c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/337351 )
Change subject: testBaseMethods: Don't fail when repository code is not found in disambcatname
......................................................................
testBaseMethods: Don't fail when repository code is not found in disambcatname
`site.disambcategory` method raises a different error message when
`site.data_repository().code` is not found in `site.family.disambcatname`.
Adjust the test to catch that error.
Bug: T153594
Change-Id: I51529dd105e491e2b13aa8b9c4e8988d0bfe2dc1
---
M tests/site_tests.py
1 file changed, 9 insertions(+), 1 deletion(-)
Approvals:
Lokal Profil: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 5b43ccf..cbe5786 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -281,7 +281,15 @@
try:
dabcat = mysite.disambcategory()
except pywikibot.Error as e:
- self.assertIn('No disambiguation category name found', str(e))
+ try:
+ self.assertIn('No disambiguation category name found', str(e))
+ except AssertionError:
+ self.assertIn(
+ 'No {repo} qualifier found for disambiguation category '
+ 'name in {fam}_family file'.format(
+ repo=mysite.data_repository().family.name,
+ fam=mysite.family.name),
+ str(e))
else:
self.assertIsInstance(dabcat, pywikibot.Category)
--
To view, visit https://gerrit.wikimedia.org/r/337351
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I51529dd105e491e2b13aa8b9c4e8988d0bfe2dc1
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/337874 )
Change subject: Update config.default_edit_summary
......................................................................
Update config.default_edit_summary
- update config.default_edit_summary from pywikibot __release__
which is 3.0-dev right now.
Change-Id: I1f8f5457a246213e4624233b5d5dd5c44ec26178
---
M pywikibot/config2.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 4af7d4a..90877ba 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -33,7 +33,7 @@
"""
#
# (C) Rob W.W. Hooft, 2003
-# (C) Pywikibot team, 2003-2016
+# (C) Pywikibot team, 2003-2017
#
# Distributed under the terms of the MIT license.
#
@@ -227,7 +227,7 @@
# edit summary to use if not supplied by bot script
# WARNING: this should NEVER be used in practice, ALWAYS supply a more
# relevant summary for bot edits
-default_edit_summary = u'Pywikibot v.2'
+default_edit_summary = u'Pywikibot 3.0-dev'
# What permissions to use to set private files to it
# such as password file.
--
To view, visit https://gerrit.wikimedia.org/r/337874
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f8f5457a246213e4624233b5d5dd5c44ec26178
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>