http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11379
Revision: 11379 Author: drtrigon Date: 2013-04-17 17:05:23 +0000 (Wed, 17 Apr 2013) Log Message: ----------- bug fix; enable continuation in searchentities
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-04-17 15:48:52 UTC (rev 11378) +++ trunk/pywikipedia/wikipedia.py 2013-04-17 17:05:23 UTC (rev 11379) @@ -4153,7 +4153,7 @@ return 302, response.msg, data['success'] return 302, response.msg, False
- def createitem(self, summary=None, value=None, watchArticle=False, minorEdit=True, + def createitem(self, summary=u'', value=None, watchArticle=False, minorEdit=True, token=None, newToken=False, sysop=False, captcha=None, botflag=True, maxTries=-1): """Creating an item @@ -4571,8 +4571,14 @@ if entitytype: params['type']=entitytype # retrying is done by query.GetData - data = query.GetData(params, self.site(), sysop=sysop) - search = data['search'] + search = [] + while True: + data = query.GetData(params, self.site(), sysop=sysop) + search += data['search'] + if u'search-continue' in data: + params[u'continue'] = data[u'search-continue'] + else: + break
if 'error' in data: raise RuntimeError("API query error: %s" % data)
pywikipedia-svn@lists.wikimedia.org