Revision: 6386 Author: nicdumz Date: 2009-02-20 07:53:28 +0000 (Fri, 20 Feb 2009)
Log Message: ----------- Because of arguments confusion, the default behavior of linksearch() was to yield only 500 pages. Changing the defaults so that it crawls all the pages.
Modified Paths: -------------- branches/rewrite/pywikibot/pagegenerators.py branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/pagegenerators.py =================================================================== --- branches/rewrite/pywikibot/pagegenerators.py 2009-02-20 07:06:03 UTC (rev 6385) +++ branches/rewrite/pywikibot/pagegenerators.py 2009-02-20 07:53:28 UTC (rev 6386) @@ -723,14 +723,14 @@ for page in site.shortpages(number=number, repeat=repeat): yield page[0]
-def LinksearchPageGenerator(link, step=500, site=None): +def LinksearchPageGenerator(link, limit=None, site=None): """Yields all pages that include a specified link, according to [[Special:Linksearch]].
""" if site is None: site = pywikibot.Site() - for page in site.linksearch(link, limit=step): + for page in site.linksearch(link, limit=limit): yield page
def SearchPageGenerator(query, number = 100, namespaces = None, site = None):
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2009-02-20 07:06:03 UTC (rev 6385) +++ branches/rewrite/pywikibot/site.py 2009-02-20 07:53:28 UTC (rev 6386) @@ -2452,7 +2452,7 @@
# TODO: implement patrol
- def linksearch(self, siteurl, limit=500): + def linksearch(self, siteurl, limit=None): """Backwards-compatible interface to exturlusage()""" return self.exturlusage(siteurl, limit=limit)
pywikipedia-l@lists.wikimedia.org