r11779 pywikipedia - Code Review archive

Repository:pywikipedia
Revision:r11778‎ | r11779 | r11780 >
Date:07:31, 21 July 2013
Author:legoktm
Status:ok
Tags:
Comment:
Use "total" parameter instead of deprecated "number" (bug 1629).
Modified paths:
  • /branches/rewrite/pywikibot/pagegenerators.py (modified) (history)
  • /branches/rewrite/pywikibot/site.py (modified) (history)

Diff [purge]

Index: branches/rewrite/pywikibot/site.py
@@ -3137,7 +3137,7 @@
31383138 yield (pywikibot.Page(self, pageitem['title']),
31393139 int(pageitem['value']))
31403140
3141 - @deprecate_arg("number", None)
 3141+ @deprecate_arg("number", "total")
31423142 @deprecate_arg("repeat", None)
31433143 def shortpages(self, step=None, total=None):
31443144 """Yield Pages and lengths from Special:Shortpages.
Index: branches/rewrite/pywikibot/pagegenerators.py
@@ -888,10 +888,11 @@
889889 for page, length in site.longpages(number=number, repeat=repeat):
890890 yield page
891891
892 -def ShortPagesPageGenerator(number = 100, repeat = False, site = None):
 892+
 893+def ShortPagesPageGenerator(number=100, repeat=False, site=None):
893894 if site is None:
894895 site = pywikibot.Site()
895 - for page, length in site.shortpages(number=number, repeat=repeat):
 896+ for page, length in site.shortpages(total=number, repeat=repeat):
896897 yield page
897898
898899 def LinksearchPageGenerator(link, namespaces=None, step=None, total=None,

Status & tagging log