http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11779
Revision: 11779 Author: legoktm Date: 2013-07-21 07:31:09 +0000 (Sun, 21 Jul 2013) Log Message: ----------- Use "total" parameter instead of deprecated "number" (bug 1629).
Modified Paths: -------------- branches/rewrite/pywikibot/pagegenerators.py branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/pagegenerators.py =================================================================== --- branches/rewrite/pywikibot/pagegenerators.py 2013-07-21 07:26:22 UTC (rev 11778) +++ branches/rewrite/pywikibot/pagegenerators.py 2013-07-21 07:31:09 UTC (rev 11779) @@ -888,10 +888,11 @@ for page, length in site.longpages(number=number, repeat=repeat): yield page
-def ShortPagesPageGenerator(number = 100, repeat = False, site = None): + +def ShortPagesPageGenerator(number=100, repeat=False, site=None): if site is None: site = pywikibot.Site() - for page, length in site.shortpages(number=number, repeat=repeat): + for page, length in site.shortpages(total=number, repeat=repeat): yield page
def LinksearchPageGenerator(link, namespaces=None, step=None, total=None,
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2013-07-21 07:26:22 UTC (rev 11778) +++ branches/rewrite/pywikibot/site.py 2013-07-21 07:31:09 UTC (rev 11779) @@ -3137,7 +3137,7 @@ yield (pywikibot.Page(self, pageitem['title']), int(pageitem['value']))
- @deprecate_arg("number", None) + @deprecate_arg("number", "total") @deprecate_arg("repeat", None) def shortpages(self, step=None, total=None): """Yield Pages and lengths from Special:Shortpages.