jenkins-bot has submitted this change and it was merged.
Change subject: bug 54557: add Site.wantedpages() and pagegenerators.WantedPagesPageGenerator() ......................................................................
bug 54557: add Site.wantedpages() and pagegenerators.WantedPagesPageGenerator()
Change-Id: I981d45342ed7f9eca07b2c0431b51240c496f285 --- M pywikibot/pagegenerators.py M pywikibot/site.py 2 files changed, 16 insertions(+), 0 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index b7bf132..a31d916 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -973,6 +973,13 @@ yield page
+def WantedPagesPageGenerator(total=100, site=None): + if site is None: + site = pywikibot.Site() + for page in site.wantedpages(total=total): + yield page + + def AncientPagesPageGenerator(number=100, repeat=False, site=None): if site is None: site = pywikibot.Site() diff --git a/pywikibot/site.py b/pywikibot/site.py index 9aeef23..a1d5c59 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3506,6 +3506,15 @@ step=step, total=total) return uwgen
+ def wantedpages(self, step=None, total=None): + """Yield Pages from Special:Wantedpages. + + """ + wpgen = self._generator(api.PageGenerator, + type_arg="querypage", gqppage="Wantedpages", + step=step, total=total) + return wpgen + @deprecate_arg("number", None) @deprecate_arg("repeat", None) def uncategorizedcategories(self, number=None, repeat=True,
pywikibot-commits@lists.wikimedia.org