http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11015
Revision: 11015 Author: amir Date: 2013-01-30 18:45:16 +0000 (Wed, 30 Jan 2013) Log Message: ----------- fixing bug #3602369
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-01-29 08:38:24 UTC (rev 11014) +++ trunk/pywikipedia/wikipedia.py 2013-01-30 18:45:16 UTC (rev 11015) @@ -4105,11 +4105,11 @@ 'summary': self._encodeArg(summary, 'summary'), } params['site'] = self._originSite.dbName().split('_')[0] - params['action'] = u'wbset' + items['type'] params['format'] = 'jsonfm' if items['type'] == u'item': - params['data'] = u'{"labels":{"%(label)s":{"language":"%(label)s","value":"%(value)s"}}}' \ - % {'label': items['label'], 'value': items['value']} + params['value'] = items['value'] + params['language'] = items['label'] + items['type'] = u'label' elif items['type'] == u'description': params['value'] = items['value'] params['language'] = items['language'] @@ -4119,6 +4119,7 @@ else: raise NotImplementedError( u'Wikidata action type "%s" is unknown' % items['type']) + params['action'] = u'wbset' + items['type'] if token: params['token'] = token else:
pywikipedia-svn@lists.wikimedia.org