Revision: 7070 Author: alexsh Date: 2009-07-15 21:02:49 +0000 (Wed, 15 Jul 2009)
Log Message: ----------- site().linksearch: make more efficient for detect JSON data pages
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-07-15 20:43:32 UTC (rev 7069) +++ trunk/pywikipedia/wikipedia.py 2009-07-15 21:02:49 UTC (rev 7070) @@ -5829,13 +5829,8 @@ if data['query']['exturlusage'] == []: break
- if data.has_key(u'query-continue'): - params['euoffset'] = data[u'query-continue'][u'exturlusage'][u'euoffset'] - else: - keepGo = False
- data = data['query']['exturlusage'] - for pages in data: + for pages in data['query']['exturlusage']: if not siteurl in pages['title']: # the links themselves have similar form if pages['title'] in cache: @@ -5843,6 +5838,10 @@ else: cache.append(pages['title']) yield Page(self, pages['title']) + if data.has_key(u'query-continue'): + params['euoffset'] = data[u'query-continue'][u'exturlusage'][u'euoffset'] + else: + break else: output(u'Querying [[Special:Linksearch]]...') for url in urlsToRetrieve: