Revision: 6821 Author: russblau Date: 2009-05-04 20:43:01 +0000 (Mon, 04 May 2009)
Log Message: ----------- Fix bug 2784162 - pagebacklinks(followRedirects=True) doesn't yield redirects
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2009-05-04 16:33:49 UTC (rev 6820) +++ branches/rewrite/pywikibot/site.py 2009-05-04 20:43:01 UTC (rev 6821) @@ -1011,7 +1011,7 @@ return page._redirtarget
def preloadpages(self, pagelist, groupsize=50, templates=False, - langlinks=False): + langlinks=False): """Return a generator to a list of preloaded pages.
Note that [at least in current implementation] pages may be iterated @@ -1114,17 +1114,16 @@ # links identified by MediaWiki as redirects may not really be, # so we have to check each "redirect" page and see if it # really redirects to this page - blgen.request["gblfilterredir"] = "nonredirects" redirgen = api.PageGenerator("backlinks", gbltitle=bltitle, site=self, gblfilterredir="redirects") - if "gblnamespace" in blgen.request: - redirgen.request["gblnamespace"] = blgen.request["gblnamespace"] genlist = [blgen] for redir in redirgen: if redir.getRedirectTarget() == page: genlist.append( self.pagebacklinks( - redir, True, None, namespaces)) + redir, followRedirects=True, + filterRedirects=filterRedirects, + namespaces=namespaces)) import itertools return itertools.chain(*genlist) return blgen