jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/432717 )
Change subject: [cleanup] Deprecate pagegenerators.AllpagesPageGenerator ......................................................................
[cleanup] Deprecate pagegenerators.AllpagesPageGenerator
This function can easily replaced by Site.allpages()
Change-Id: I0e37845b9ea947aad3ede86034ba85caf75d303d --- M pywikibot/pagegenerators.py M scripts/interwiki.py 2 files changed, 7 insertions(+), 6 deletions(-)
Approvals: Zhuyifei1999: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 7c6cba6..1881a2d 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -929,10 +929,9 @@ if not value: value = '!' firstpagelink = pywikibot.Link(value, self.site) - gen = AllpagesPageGenerator(firstpagelink.title, - firstpagelink.namespace, - includeredirects=False, - site=self.site) + gen = self.site.allpages(start=firstpagelink.title, + namespace=firstpagelink.namespace, + filterredir=False) elif arg == '-prefixindex': if not value: value = pywikibot.input( @@ -1084,6 +1083,7 @@ return False
+@deprecated('Site.allpages()') @deprecated_args(step=None) def AllpagesPageGenerator(start='!', namespace=0, includeredirects=True, site=None, total=None, content=False): diff --git a/scripts/interwiki.py b/scripts/interwiki.py index 67ee1b7..a087a86 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -2518,8 +2518,9 @@ 'Dump file is empty?! Starting at the beginning.') nextPage = "!" namespace = 0 - gen2 = pagegenerators.AllpagesPageGenerator( - nextPage, namespace, includeredirects=False) + gen2 = site.allpages(start=nextPage, + namespace=namespace, + filterredir=False) hintlessPageGen = chain(hintlessPageGen, gen2) restoredFiles.append(dumpFileName)