Revision: 4207 Author: wikipedian Date: 2007-09-07 13:08:19 +0000 (Fri, 07 Sep 2007)
Log Message: ----------- preloading generator: filter out pages from other sites (required for -interwiki parameter)
Modified Paths: -------------- trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py =================================================================== --- trunk/pywikipedia/pagegenerators.py 2007-09-07 12:57:23 UTC (rev 4206) +++ trunk/pywikipedia/pagegenerators.py 2007-09-07 13:08:19 UTC (rev 4207) @@ -500,6 +500,8 @@ def preload(self, pages): try: site = pages[0].site() + # filter out pages that are on other sites + pages = filter(lambda p: p.site() == site, pages) wikipedia.getall(site, pages, throttle=False) except IndexError: # Can happen if the pages list is empty. Don't care.