Revision: 5900 Author: russblau Date: 2008-09-16 20:03:23 +0000 (Tue, 16 Sep 2008)
Log Message: ----------- allow for "generator=" in QueryGenerator
Modified Paths: -------------- branches/rewrite/pywikibot/data/api.py
Modified: branches/rewrite/pywikibot/data/api.py =================================================================== --- branches/rewrite/pywikibot/data/api.py 2008-09-16 15:09:00 UTC (rev 5899) +++ branches/rewrite/pywikibot/data/api.py 2008-09-16 20:03:23 UTC (rev 5900) @@ -306,9 +306,12 @@ self.prefix = "g" + self.prefix self.request = Request(**kwargs) self.limit = None - self.resultkey = self.module # this is the name of the "query" - # subelement to look for when iterating - + if "generator" in kwargs: + self.resultkey = "pages" # name of the "query" + else: # subelement key + self.resultkey = self.module # to look for when iterating + + def get_module(self): """Query api on self.site for paraminfo on querymodule=self.module"""
pywikipedia-l@lists.wikimedia.org