comparison src/plugins/plugin_exp_pubsub_schema.py @ 2378:3704cb959ae8

plugin schema: deserialise is now the last kw argument
author Goffi <goffi@goffi.org>
date Mon, 16 Oct 2017 07:23:09 +0200
parents 2268df8c99bf
children 72c30e73a9a5
comparison
equal deleted inserted replaced
2377:e50aee5caf33 2378:3704cb959ae8
241 service = None if not service else jid.JID(service) 241 service = None if not service else jid.JID(service)
242 if schema: 242 if schema:
243 schema = generic.parseXml(schema.encode('utf-8')) 243 schema = generic.parseXml(schema.encode('utf-8'))
244 else: 244 else:
245 schema = None 245 schema = None
246 d = self.sendDataFormItem(client, service, nodeIdentifier, values, schema, True, item_id or None, extra) 246 d = self.sendDataFormItem(client, service, nodeIdentifier, values, schema, item_id or None, extra, deserialise=True)
247 d.addCallback(lambda ret: ret or u'') 247 d.addCallback(lambda ret: ret or u'')
248 return d 248 return d
249 249
250 @defer.inlineCallbacks 250 @defer.inlineCallbacks
251 def sendDataFormItem(self, client, service, nodeIdentifier, values, schema=None, deserialise=False, item_id=None, extra=None): 251 def sendDataFormItem(self, client, service, nodeIdentifier, values, schema=None, item_id=None, extra=None, deserialise=False):
252 """Publish an item as a dataform when we know that there is a schema 252 """Publish an item as a dataform when we know that there is a schema
253 253
254 @param values(dict[[iterable[object], object]): values set for the form 254 @param values(dict[[iterable[object], object]): values set for the form
255 if not iterable, will be put in a list 255 if not iterable, will be put in a list
256 @param schema(domish.Element, data_form.Form, None): data schema 256 @param schema(domish.Element, data_form.Form, None): data schema