Page MenuHomePhabricator
Authored By
bzimport
Nov 22 2014, 2:09 AM
Size
1 KB
Referenced Files
None
Subscribers
None

diff.txt

Index: wikipedia.py
===================================================================
--- wikipedia.py (Revision 11710)
+++ wikipedia.py (Arbeitskopie)
@@ -4281,7 +4281,15 @@
return response.code, response.msg, data
def editclaim(self, WDproperty, value, data_type=None, raw_value=False, refs=None,
- comment=None, token=None, sysop=False, botflag=True):
+ comment=None, token=None, sysop=False, botflag=True, force_add=False):
+ """Adds or edits a claim.
+
+ If the item has the given claim already, the value of the claim is changed. If not, the claim is added. References are always added.
+
+ @param WDproperty: the property to add
+ @param value: the value to add
+ @param force_add: do not change the existing value but add additional value
+ """
if isinstance(WDproperty, int):
propertyID = WDproperty
elif isinstance(WDproperty, basestring):
@@ -4334,7 +4342,7 @@
for claim in claims:
if claim['m'][1] == propertyID:
theclaim = claim
- if theclaim:
+ if theclaim and not force_add:
params = {
'action': 'wbsetclaimvalue',
'claim': theclaim['g'],

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11334
Default Alt Text
diff.txt (1 KB)

Event Timeline