Revision: 6736 Author: shizhao Date: 2009-04-27 13:06:57 +0000 (Mon, 27 Apr 2009)
Log Message: ----------- fix bug 2780178: repeat = True, can't agian load new
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-04-27 12:29:10 UTC (rev 6735) +++ trunk/pywikipedia/wikipedia.py 2009-04-27 13:06:57 UTC (rev 6736) @@ -5284,18 +5284,18 @@ 'letype' :'upload', 'lelimit' :int(number), } - if lestart is not None: params['lestart'] = lestart - if leend is not None: params['leend'] = leend - if leend is not None: params['leuser'] = leuser - if leend is not None: params['letitle'] = letitle + if lestart != None: params['lestart'] = lestart + if leend != None: params['leend'] = leend + if leend != None: params['leuser'] = leuser + if leend != None: params['letitle'] = letitle + while True: + data = query.GetData(params, + useAPI = True, encodeTitle = False) + try: + imagesData = data['query']['logevents'] + except KeyError: + raise ServerError("The APIs don't return the data, the site may be down")
- data = query.GetData(params, - useAPI = True, encodeTitle = False) - try: - imagesData = data['query']['logevents'] - except KeyError: - raise ServerError("The APIs don't return the data, the site may be down") - while True: for imageData in imagesData: try: comment = imageData['comment']
pywikipedia-svn@lists.wikimedia.org