http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11344
Revision: 11344 Author: legoktm Date: 2013-04-05 21:24:17 +0000 (Fri, 05 Apr 2013) Log Message: ----------- Setting labels/descriptions need to set a language value.
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2013-04-05 18:54:38 UTC (rev 11343) +++ branches/rewrite/pywikibot/page.py 2013-04-05 21:24:17 UTC (rev 11344) @@ -2348,6 +2348,8 @@ You can set it to '' to remove the label. """ labels = self.__normalizeLanguages(labels) + for key in labels: + labels[key] = {'language': key, 'value': labels[key]} data = {'labels': labels} self.editEntity(data, **kwargs)
@@ -2359,6 +2361,8 @@ You can set it to '' to remove the description. """ descriptions = self.__normalizeLanguages(descriptions) + for key in descriptions: + descriptions[key] = {'language': key, 'value': descriptions[key]} data = {'descriptions': descriptions} self.editEntity(data, **kwargs)