r11778 pywikipedia - Code Review archive

Repository:pywikipedia
Revision:r11777‎ | r11778 | r11779 >
Date:07:26, 21 July 2013
Author:legoktm
Status:new
Tags:
Comment:
Prevent attempting of editing of Qualifier claims, and automatically add the lastrevid parameter
Modified paths:
  • /branches/rewrite/pywikibot/site.py (modified) (history)

Diff [purge]

Index: branches/rewrite/pywikibot/site.py
@@ -3443,7 +3443,7 @@
34443444 Sets the claim target to whatever claim.target is
34453445 An optional snaktype lets you set a novalue or somevalue.
34463446 """
3447 - if claim.isReference:
 3447+ if claim.isReference or claim.isQualifier:
34483448 raise NotImplementedError
34493449 if not claim.snak:
34503450 #We need to already have the snak value
@@ -3458,10 +3458,7 @@
34593459 if snaktype == 'value':
34603460 params['value'] = json.dumps(claim._formatDataValue())
34613461
3462 - for arg in kwargs:
3463 - #TODO: Get the lastrevid from the item
3464 - if arg in ['bot','lastrevid']:
3465 - params[arg] = kwargs[arg]
 3462+ params['lastrevid'] = claim.on_item.lastrevid
34663463 req = api.Request(site=self, **params)
34673464 data = req.submit()
34683465 return data