jenkins-bot has submitted this change and it was merged.
Change subject: Change of pagegenerator in test_pageid
......................................................................
Change of pagegenerator in test_pageid
On zh.wikisource (where test was failing) are no articles starting from A.
Because this test checks generator for page_id's and it doesn't matter what
generator was initially used, I'm changing it to -random.
Bug: T151168
Change-Id: I4dba6d50c74136306434d7286d492f8a9a8deb9b
---
M tests/pagegenerators_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 73b98a5..f0e123e 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -895,7 +895,7 @@
"""Test pageid parameter."""
# Get reference pages and their pageids.
gf = pagegenerators.GeneratorFactory(site=self.get_site())
- self.assertTrue(gf.handleArg('-prefixindex:a'))
+ self.assertTrue(gf.handleArg('-random'))
gf.handleArg('-limit:10')
gen = gf.getCombinedGenerator()
pages = list(gen)
--
To view, visit https://gerrit.wikimedia.org/r/322597
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4dba6d50c74136306434d7286d492f8a9a8deb9b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(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.
Change subject: Rollback to old limit in deprecated generator
......................................................................
Rollback to old limit in deprecated generator
We decided to leave intrinsic limit in deprecated page generator.
It will in fact made test_logevents_default passed.
Bug: T151150
Change-Id: I70613731b697ad156ddad0ea9c5ef347df8454c0
---
M pywikibot/pagegenerators.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index a664119..f2f68de 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -906,7 +906,7 @@
# exclude -log, -nolog
if log == 'log' and mode not in ['-', '-no'] and not tail:
mode = mode[1:]
- total = None
+ total = 500
if value:
try:
total = int(value)
--
To view, visit https://gerrit.wikimedia.org/r/322501
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I70613731b697ad156ddad0ea9c5ef347df8454c0
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Lokal Profil <lokal.profil(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [doc] Add some documentation to PrefixingPageGenerator
......................................................................
[doc] Add some documentation to PrefixingPageGenerator
Change-Id: If79dbef6a0877344ec22aa980c932eee9df9d27d
---
M pywikibot/pagegenerators.py
1 file changed, 14 insertions(+), 2 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e4bc8da..e0fb239 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -981,11 +981,23 @@
"""
Prefixed Page generator.
+ @param prefix: The prefix of the pages.
+ @type prefix: str
+ @param namespace: Namespace to retrieve pages from
+ @type namespace: Namespace or int
+ @param includeredirects: If includeredirects is None, False or an empty
+ string, redirects will not be found. If includeredirects equals the
+ string 'only', only redirects will be found. Otherwise redirects will
+ be included.
+ @type includeredirects: None, bool, str
+ @param site: Site for generator results.
+ @type site: L{pywikibot.site.BaseSite}
@param total: Maximum number of pages to retrieve in total
@type total: int
@param content: If True, load current version of each page (default False)
- @param site: Site for generator results.
- @type site: L{pywikibot.site.BaseSite}
+ @type content: bool
+ @return: a generator that yields Page objects
+ @rtype: generator
"""
if site is None:
site = pywikibot.Site()
--
To view, visit https://gerrit.wikimedia.org/r/279936
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If79dbef6a0877344ec22aa980c932eee9df9d27d
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
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: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: APIGenerator.set_maximum_items: Don't compare int with None
......................................................................
APIGenerator.set_maximum_items: Don't compare int with None
`query_increment` can be None. In Python 2 None is less than any number but
Python 3 raises "TypeError: unorderable types: int() < NoneType()".
test_continue (tests.site_tests.TestDataSiteSearchEntities) was failing
because of this issue.
Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index c087bb5..3b2ae9d 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2435,7 +2435,7 @@
@type value: int
"""
self.limit = int(value)
- if self.limit < self.query_increment:
+ if self.query_increment and self.limit < self.query_increment:
self.request[self.limit_name] = self.limit
pywikibot.debug(u"%s: Set request item limit to %i"
% (self.__class__.__name__, self.limit), _logger)
--
To view, visit https://gerrit.wikimedia.org/r/322232
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I73e711014303a397a1009c76798d2cfefabc608b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
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 <>
jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] Solve pagegeneratrors_tests.TestFactoryGeneratorWikibase tests
......................................................................
[bugfix] Solve pagegeneratrors_tests.TestFactoryGeneratorWikibase tests
- P357 was redirected to P1476. Use the new property ID to solve the
KeyError
- There was a hidden bug when comparing the WbMonolingualText because
value is a basestring and does not have a __dict__ which is used by
the WbRepresentation class. Add a new part for WBMonolingualText into
Claim.target_equals() to solve it
Bug: T150653
Change-Id: I4a2602d7d27f66615699af90b599a8a0ad623c50
---
M pywikibot/page.py
M tests/pagegenerators_tests.py
2 files changed, 7 insertions(+), 2 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 165e7c8..9c59baf 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4631,6 +4631,7 @@
- ItemPage ID equality
- WbTime year equality
- Coordinate equality, regarding precision
+ - WbMonolingualText text equality
- direct equality
@param value: the value to compare with
@@ -4662,6 +4663,10 @@
return (abs(self.target.lat - coord_args[0]) <= precision and
abs(self.target.lon - coord_args[1]) <= precision)
+ if (isinstance(self.target, pywikibot.WbMonolingualText) and
+ isinstance(value, basestring)):
+ return self.target.text == value
+
return self.target == value
def has_qualifier(self, qualifier_id, target):
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 06380ef..6b243ee 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -1007,7 +1007,7 @@
"""Test -onlyif without qualifiers."""
gf = pagegenerators.GeneratorFactory(site=self.site)
gf.handleArg('-page:Q15745378')
- gf.handleArg('-onlyif:P357=International Journal of Minerals\, '
+ gf.handleArg('-onlyif:P1476=International Journal of Minerals\, '
'Metallurgy\, and Materials')
gen = gf.getCombinedGenerator()
self.assertIsNotNone(gen)
@@ -1017,7 +1017,7 @@
"""Test -onlyifnot without qualifiers."""
gf = pagegenerators.GeneratorFactory(site=self.site)
gf.handleArg('-page:Q15745378')
- gf.handleArg('-onlyifnot:P357=International Journal of Minerals\, '
+ gf.handleArg('-onlyifnot:P1476=International Journal of Minerals\, '
'Metallurgy\, and Materials')
gen = gf.getCombinedGenerator()
self.assertIsNotNone(gen)
--
To view, visit https://gerrit.wikimedia.org/r/321364
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4a2602d7d27f66615699af90b599a8a0ad623c50
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
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: Ladsgroup <Ladsgroup(a)gmail.com>
Gerrit-Reviewer: M4tx <m4tx(a)m4tx.pl>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
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.
Change subject: [bugfix] remove UntaggedPageGenerator
......................................................................
[bugfix] remove UntaggedPageGenerator
- https://toolserver.org/~daniel/WikiSense/UntaggedImages.php is no longer
available and the project has been discontinued. Remove it.
Change-Id: I68805b101856ffc272d0022193f9ec32f077da31
---
M pywikibot/pagegenerators.py
1 file changed, 1 insertion(+), 38 deletions(-)
Approvals:
Dalba: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 605ebd8..d4677e7 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -49,7 +49,6 @@
)
from pywikibot import date, config, i18n, xmlreader
-from pywikibot.comms import http
from pywikibot.exceptions import ArgumentDeprecationWarning, UnknownExtension
from pywikibot.proofreadpage import ProofreadPage
@@ -277,11 +276,6 @@
[[Special:RandomRedirect]]. Can also be given as
"-randomredirect:n" where n is the number of pages to be
returned.
-
--untagged Work on image pages that don't have any license template on a
- site given in the format "<language>.<project>.org, e.g.
- "ja.wikipedia.org" or "commons.wikimedia.org".
- Using an external Toolserver tool.
-google Work on all pages that are found in a Google search.
You need a Google Web API license key. Note that Google
@@ -879,7 +873,7 @@
elif arg == '-yahoo':
gen = YahooSearchPageGenerator(value, site=self.site)
elif arg == '-untagged':
- gen = UntaggedPageGenerator(value, site=self.site)
+ issue_deprecation_warning(arg, None, 2)
elif arg == '-wikidataquery':
if not value:
value = pywikibot.input('WikidataQuery string:')
@@ -2291,37 +2285,6 @@
site = pywikibot.Site()
for page in site.search(query, total=total, namespaces=namespaces):
yield page
-
-
-def UntaggedPageGenerator(untaggedProject, limit=500, site=None):
- """
- Yield pages from defunct toolserver UntaggedImages.php.
-
- It was using this tool:
- https://toolserver.org/~daniel/WikiSense/UntaggedImages.php
-
- @param site: Site for generator results.
- @type site: L{pywikibot.site.BaseSite}
- """
- URL = "https://toolserver.org/~daniel/WikiSense/UntaggedImages.php?"
- REGEXP = r"<td valign='top' title='Name'><a href='http[s]?://.*?" \
- "\.org/w/index\.php\?title=(.*?)'>.*?</a></td>"
- lang, project = untaggedProject.split('.', 1)
- if lang == 'commons':
- wiki = 'wikifam=commons.wikimedia.org'
- else:
- wiki = 'wikilang=%s&wikifam=.%s' % (lang, project)
- link = '%s&%s&max=%d&order=img_timestamp' % (URL, wiki, limit)
- results = re.findall(REGEXP, http.fetch(link))
- if not results:
- raise pywikibot.Error(
- u'Nothing found at %s! Try to use the tool by yourself to be sure '
- u'that it works!' % link)
- if not site:
- site = pywikibot.Site()
- else:
- for result in results:
- yield pywikibot.Page(site, result)
def LiveRCPageGenerator(site=None, total=None):
--
To view, visit https://gerrit.wikimedia.org/r/321840
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I68805b101856ffc272d0022193f9ec32f077da31
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
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 <>