http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11268
Revision: 11268 Author: amir Date: 2013-03-25 14:30:06 +0000 (Mon, 25 Mar 2013) Log Message: ----------- adding &bot=1 for editclaime and using json for create
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-03-25 14:19:36 UTC (rev 11267) +++ trunk/pywikipedia/wikipedia.py 2013-03-25 14:30:06 UTC (rev 11268) @@ -4265,7 +4265,9 @@ 'title': self._originTitle, 'site': self._siteTitle}) else: - params['data'] = re.sub(ur"\bu'", u'"',repr(value).decode("unicode-escape")).replace("'", '"') + value=json.dumps(value) + value=value.replace("'", '"') + params['data'] = value if token: params['token'] = token else: @@ -4397,6 +4399,8 @@ 'value': value, } params['token'] = token or self.site().getToken(sysop=sysop) + if botflag: + params['bot'] = 1 output(u"Changing %s" % self.title()) data = query.GetData(params, self.site(), sysop=sysop) if 'error' in data: @@ -4413,6 +4417,8 @@ 'value': value, } params['token'] = token or self.site().getToken(sysop=sysop) + if botflag: + params['bot'] = 1 output(u"Creating %s" % self.title()) data = query.GetData(params, self.site(), sysop=sysop) if 'error' in data: @@ -4477,6 +4483,8 @@ params['token'] = token else: params['token'] = self.site().getToken(sysop = sysop) + if botflag: + params['bot'] = 1 output(u"Adding references to %s" % self.title()) data = query.GetData(params, self.site(), sysop=sysop) if 'error' in data: