jenkins-bot has submitted this change and it was merged.
Change subject: Added a test for the method newfiles
......................................................................
Added a test for the method newfiles
Change-Id: I2c6994add3834417c47d397f21125f2d03b57f53
---
M tests/site_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 224f76d..f0e8468 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -554,6 +554,18 @@
self.assertTrue(mysite.page_exists(impage))
self.assertLessEqual(impage._imageinfo["size"], 2000)
+ def test_newfiles(self):
+ """Test the site.newfiles() method."""
+ my_site = self.get_site()
+ the_list = list(my_site.newfiles(total=10))
+ self.assertLessEqual(len(the_list), 10)
+ self.assertTrue(all(isinstance(tup, tuple) and len(tup) == 4
+ for tup in the_list))
+ self.assertTrue(all(isinstance(tup[0], pywikibot.FilePage) for tup in the_list))
+ self.assertTrue(all(isinstance(tup[1], pywikibot.Timestamp) for tup in the_list))
+ self.assertTrue(all(isinstance(tup[2], unicode) for tup in the_list))
+ self.assertTrue(all(isinstance(tup[3], unicode) for tup in the_list))
+
def testBlocks(self):
"""Test the site.blocks() method."""
mysite = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/178891
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2c6994add3834417c47d397f21125f2d03b57f53
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Anshoe <contactanshumanagarwal(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: jenkins-bot <>
Build Update for jayvdb/pywikibot-core
-------------------------------------
Build: #159
Status: Failed
Duration: 40 minutes and 43 seconds
Commit: ff338ce (review/john_vandenberg/test-pwb-is-not-site)
Author: John Vandenberg
Message: Miscellaneous pwb improvements
Improve pwb emulation of Python 3, so that it sets __builtins__ and
__package__, doesnt use imp module deprecated in Python 3.4. These
changes are partial sync with the coverage code from whence it came.
Minor updates to our pwb test so it now works in Python 3. The
same coverage test is now wildly more complex; beyond pywikibot's
needs.
c5d5b01 removed Site interaction from the library bootstrap logic.
The pwb tests can now be flagged as 'net' only, and not 'site', tests.
The tests now run pre-merge with jenkins.
Move the pwb running functionality out of script_tests into utils.
Change-Id: Ic2443c17c9ad3976d654b2dd29201cfc12134322
View the changeset: https://github.com/jayvdb/pywikibot-core/compare/4200981a5021^...ff338ce623…
View the full build log and details: https://travis-ci.org/jayvdb/pywikibot-core/builds/43634085
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: Remove unused method Family.has_query_api()
......................................................................
Remove unused method Family.has_query_api()
Copied from compat by Russell Blau
with commit 3ada8266b67e025a95c4f9d35a38882b84d98cc7,
it was never used according to the Git history.
Moreover, the old MediaWiki query.php API to which has_query_api
refers has been shut down as of 25 August, 2008.
Change-Id: I00d0a8f447b08969820841a190da725bbb00d4bc
---
M pywikibot/family.py
1 file changed, 0 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 8b7ab5c..a4c5d80 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1163,10 +1163,6 @@
def __repr__(self):
return 'Family("%s")' % self.name
- def has_query_api(self, code):
- """Check query.php installed in the wiki."""
- return False
-
def shared_image_repository(self, code):
"""Return the shared image repository, if any."""
return (None, None)
--
To view, visit https://gerrit.wikimedia.org/r/178776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I00d0a8f447b08969820841a190da725bbb00d4bc
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
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: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Allow multiple namespaces if available
......................................................................
[FIX] Allow multiple namespaces if available
Some modules don't support multiple namespaces (for example
query+allpages) but it's possible that the generator factory sets it to
multiple namespaces. This also emits a warning if the namespace is
defined for a generator which does not support it.
Bug: T76794
Change-Id: I486d06fa6e03692f7c05725b22319e192b5d62c2
---
M pywikibot/data/api.py
1 file changed, 19 insertions(+), 7 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index cf8ce17..a460313 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1383,14 +1383,26 @@
"""
assert(self.limited_module) # some modules do not have a prefix
- if isinstance(namespaces, list):
- namespaces = "|".join(str(n) for n in namespaces)
- else:
- namespaces = str(namespaces)
-
param = self.site._paraminfo.parameter(self.limited_module, 'namespace')
- if param:
- self.request[self.prefix + "namespace"] = namespaces
+ if not param:
+ pywikibot.warning(u'{0} module does not support a namespace '
+ 'parameter'.format(self.limited_module))
+ return
+
+ if isinstance(namespaces, basestring):
+ namespaces = namespaces.split('|')
+
+ try:
+ iter(namespaces)
+ except TypeError:
+ namespaces = [namespaces]
+
+ namespaces = [str(namespace) for namespace in namespaces]
+ if 'multi' not in param and len(namespaces) != 1:
+ raise pywikibot.Error(u'{0} module does not support multiple '
+ 'namespaces.'.format(self.limited_module))
+
+ self.request[self.prefix + "namespace"] = namespaces
def _query_continue(self):
if all(key not in self.data[self.continue_name]
--
To view, visit https://gerrit.wikimedia.org/r/178709
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I486d06fa6e03692f7c05725b22319e192b5d62c2
Gerrit-PatchSet: 3
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Deprecate everything in compat.catlib and compat.userlib
......................................................................
Deprecate everything in compat.catlib and compat.userlib
Id est:
* compat.catlib.Category
* compat.catlib.change_category()
* compat.userlib.User
The 'compat' submodule was never meant for direct use, but
a real deprecation notice has never been added.
Since replacing them with their 'core' equivalents is a
no-brainer, they will be removed quite soon.
Change-Id: Iaa29035d8f645724c4a5d09d90e64e03f2823f9a
---
M pywikibot/compat/catlib.py
M pywikibot/compat/userlib.py
2 files changed, 9 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
XZise: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/compat/catlib.py b/pywikibot/compat/catlib.py
index 985f6af..d4f7b48 100644
--- a/pywikibot/compat/catlib.py
+++ b/pywikibot/compat/catlib.py
@@ -15,6 +15,7 @@
from pywikibot import Category
+from pywikibot.tools import ModuleDeprecationWrapper
def change_category(article, oldCat, newCat, comment=None, sortKey=None,
@@ -22,3 +23,7 @@
return article.change_category(oldCat, newCat, comment, sortKey, inPlace)
__all__ = ('Category', 'change_category',)
+
+wrapper = ModuleDeprecationWrapper(__name__)
+wrapper._add_deprecated_attr('Category', replacement_name='pywikibot.Category')
+wrapper._add_deprecated_attr('change_category', replacement_name='Page.change_category')
diff --git a/pywikibot/compat/userlib.py b/pywikibot/compat/userlib.py
index 7150992..4c999c7 100644
--- a/pywikibot/compat/userlib.py
+++ b/pywikibot/compat/userlib.py
@@ -15,5 +15,9 @@
from pywikibot import User
+from pywikibot.tools import ModuleDeprecationWrapper
__all__ = ('User',)
+
+wrapper = ModuleDeprecationWrapper(__name__)
+wrapper._add_deprecated_attr('User', replacement_name='pywikibot.User')
--
To view, visit https://gerrit.wikimedia.org/r/178577
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa29035d8f645724c4a5d09d90e64e03f2823f9a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
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 <>
jenkins-bot has submitted this change and it was merged.
Change subject: Remove disambiguationTemplates from wikipedia_family.py
......................................................................
Remove disambiguationTemplates from wikipedia_family.py
The 'disambiguationTemplates' attribute of Family classes is
only used in the .disambig() method, which is in turn called
only by Page.isDisambig() and only if the Disambiguator extension
isn't available (commit a62b2475323efb5b694ae98444130b13d275de68).
Since the latter is enabled on every Wikimedia site, the hardcoded
list will never be used.
Change-Id: I6979acd9483f72fba005c06c646c3a9caa63686a
---
M pywikibot/families/wikipedia_family.py
1 file changed, 0 insertions(+), 27 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/wikipedia_family.py b/pywikibot/families/wikipedia_family.py
index dc01e91..12333bb 100644
--- a/pywikibot/families/wikipedia_family.py
+++ b/pywikibot/families/wikipedia_family.py
@@ -132,33 +132,6 @@
u'分類跳轉',),
}
- self.disambiguationTemplates = {
- # If no templates are given, retrieve names from the live wiki
- # ([[MediaWiki:Disambiguationspage]])
- # first char must be in uppercase
- '_default': [u'Disambig'], # for default MediaWiki message only
- 'haw': [u'Huaʻōlelo puana like'],
- 'no': [u'Peker', u'Etternavn', u'Disambig',
- u'Tobokstavsforkortelse', u'Trebokstavsforkortelse',
- u'Flertydig', u'Pekerside'],
- 'nov': [u'Desambig'],
- 'qu': [u"Sut'ichana qillqa", u'Disambig', u'SJM'],
- 'rmy': [u'Dudalipen'],
- 'sk': [u'Disambig', u'Rozlišovacia stránka', u'Disambiguation'],
- 'tg': [u'Ибҳомзудоӣ', u'Disambig', u'Рафъи ибҳом',
- u'Disambiguation'],
- 'tr': [u'Anlam ayrım', u'Disambig', u'Anlam ayrımı',
- u'Kişi adları (anlam ayrımı)',
- u'Yerleşim yerleri (anlam ayrımı)',
- u'kısaltmalar (anlam ayrımı)', u'Coğrafya (anlam ayrımı)',
- u'Yerleşim yerleri (anlam ayrımı)', u'Sayılar (anlam ayrımı)',
- u"ABD'deki iller (anlam ayrımı)"],
- 'wo': [u'Bokktekki'],
- 'yi': [u'באדייטען'],
- 'zea': [u'Dp', u'Deurverwiespagina'],
- 'zh-classical': [u'釋義', u'消歧義', u'Disambig'],
- }
-
self.disambcatname = {
'af': u'dubbelsinnig',
'als': u'Begriffsklärung',
--
To view, visit https://gerrit.wikimedia.org/r/178765
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6979acd9483f72fba005c06c646c3a9caa63686a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
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 <>