comparison src/tmp/wokkel/pubsub.py @ 2200:95dc90f1065a

tmp (wokkel/pubsub): fixed configuration setting
author Goffi <goffi@goffi.org>
date Thu, 23 Mar 2017 09:07:10 +0100
parents 44f12990e275
children 7f91b894bfdf
comparison
equal deleted inserted replaced
2199:ea0d0a4e2ad8 2200:95dc90f1065a
469 def _parse_configureOrNone(self, verbElement): 469 def _parse_configureOrNone(self, verbElement):
470 """ 470 """
471 Parse optional node configuration form in create request. 471 Parse optional node configuration form in create request.
472 """ 472 """
473 for element in verbElement.parent.elements(): 473 for element in verbElement.parent.elements():
474 if element.uri == NS_PUBSUB and element.name == 'configure': 474 if element.uri == NS_PUBSUB_OWNER and element.name == 'configure':
475 form = data_form.findForm(element, NS_PUBSUB_NODE_CONFIG) 475 form = data_form.findForm(element, NS_PUBSUB_NODE_CONFIG)
476 if form is not None: 476 if form is not None:
477 if form.formType != 'submit': 477 if form.formType != 'submit':
478 raise BadRequest(text=u"Unexpected form type '%s'" % 478 raise BadRequest(text=u"Unexpected form type '%s'" %
479 form.formType) 479 form.formType)
486 def _render_configureOrNone(self, verbElement): 486 def _render_configureOrNone(self, verbElement):
487 """ 487 """
488 Render optional node configuration form in create request. 488 Render optional node configuration form in create request.
489 """ 489 """
490 if self.options is not None: 490 if self.options is not None:
491 configure = verbElement.parent.addElement('configure') 491 if verbElement.name == 'configure':
492 configure = verbElement
493 else:
494 configure = verbElement.parent.addElement('configure')
492 configure.addChild(self.options.toElement()) 495 configure.addChild(self.options.toElement())
493 496
494 497
495 def _parse_itemIdentifiers(self, verbElement): 498 def _parse_itemIdentifiers(self, verbElement):
496 """ 499 """
1264 return d 1267 return d
1265 1268
1266 1269
1267 def _onPubSubRequest(self, iq): 1270 def _onPubSubRequest(self, iq):
1268 request = self._request_class.fromElement(iq) 1271 request = self._request_class.fromElement(iq)
1269
1270 if self.resource is not None: 1272 if self.resource is not None:
1271 resource = self.resource.locateResource(request) 1273 resource = self.resource.locateResource(request)
1272 else: 1274 else:
1273 resource = self 1275 resource = self
1274 1276