http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10463
Revision: 10463 Author: xqt Date: 2012-07-29 11:31:05 +0000 (Sun, 29 Jul 2012) Log Message: ----------- bugfix for query-continue param introduced with mw 1.20wmf8 (bug #3550060)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2012-07-24 05:26:17 UTC (rev 10462) +++ trunk/pywikipedia/wikipedia.py 2012-07-29 11:31:05 UTC (rev 10463) @@ -3594,10 +3594,14 @@ count += 1 self._deletedRevs[parsetime2stamp(y['timestamp'])] = [y['timestamp'], y['user'], y['comment'] , y['*'], False]
- if 'query-continue' in data and \ - data['query-continue']['deletedrevs']['drcontinue'].split( - '|')[1] == self.title(withNamespace=False): - params['drcontinue'] = data['query-continue']['deletedrevs']['drcontinue'] + if 'query-continue' in data: + # get the continue key for backward compatibility + # with pre 1.20wmf8 + contKey = data['query-continue']['deletedrevs'].keys()[0] + if data['query-continue']['deletedrevs'][contKey].split( + '|')[1] == self.title(withNamespace=False): + params[contKey] = data['query-continue']['deletedrevs'][contKey] + else: break else: break self._deletedRevsModified = False @@ -7127,7 +7131,9 @@ if count >= config.special_page_limit: break if 'query-continue' in data and count < params['aplimit']: - params['apfrom'] = data['query-continue']['allpages']['apfrom'] + # get the continue key for backward compatibility with pre 1.20wmf8 + contKey = data['query-continue']['allpages'].keys()[0] + params[contKey] = data['query-continue']['allpages'][contKey] else: break