http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11778
Revision: 11778 Author: legoktm Date: 2013-07-21 07:26:22 +0000 (Sun, 21 Jul 2013) Log Message: ----------- Prevent attempting of editing of Qualifier claims, and automatically add the lastrevid parameter
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2013-07-21 06:58:03 UTC (rev 11777) +++ branches/rewrite/pywikibot/site.py 2013-07-21 07:26:22 UTC (rev 11778) @@ -3443,7 +3443,7 @@ Sets the claim target to whatever claim.target is An optional snaktype lets you set a novalue or somevalue. """ - if claim.isReference: + if claim.isReference or claim.isQualifier: raise NotImplementedError if not claim.snak: #We need to already have the snak value @@ -3458,10 +3458,7 @@ if snaktype == 'value': params['value'] = json.dumps(claim._formatDataValue())
- for arg in kwargs: - #TODO: Get the lastrevid from the item - if arg in ['bot','lastrevid']: - params[arg] = kwargs[arg] + params['lastrevid'] = claim.on_item.lastrevid req = api.Request(site=self, **params) data = req.submit() return data
pywikipedia-svn@lists.wikimedia.org