Revision: 6696 Author: russblau Date: 2009-04-24 12:44:52 +0000 (Fri, 24 Apr 2009)
Log Message: ----------- Update DuplicateFilterPageGenerator as per recent changes to trunk
Modified Paths: -------------- branches/rewrite/pywikibot/pagegenerators.py
Modified: branches/rewrite/pywikibot/pagegenerators.py =================================================================== --- branches/rewrite/pywikibot/pagegenerators.py 2009-04-24 06:46:34 UTC (rev 6695) +++ branches/rewrite/pywikibot/pagegenerators.py 2009-04-24 12:44:52 UTC (rev 6696) @@ -605,10 +605,13 @@
def DuplicateFilterPageGenerator(generator): """Yield all unique pages from another generator, omitting duplicates.""" - seenPages = set([]) + seenPages = {} for page in generator: if page not in seenPages: - seenPages.add(page) + _page = u"%s:%s:%s" % (page._site.family.name, + page._site.code, + page._title) + seenPages[_page] = True yield page