Changeset 80:3ee3e922549d for wokkel/pubsub.py
- Timestamp:
- Jan 5, 2010, 2:55:40 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wokkel/pubsub.py
r79 r80 253 253 254 254 255 @staticmethod256 def _findForm(element, formNamespace):257 """258 Find a Data Form.259 260 Look for an element that represents a Data Form with the specified261 form namespace as a child element of the given element.262 """263 if not element:264 return None265 266 form = None267 for child in element.elements():268 try:269 form = data_form.Form.fromElement(child)270 except data_form.Error:271 continue272 273 if form.formNamespace != NS_PUBSUB_NODE_CONFIG:274 continue275 276 return form277 278 279 255 def _parse_node(self, verbElement): 280 256 """ … … 367 343 Parse node type out of a request for the default node configuration. 368 344 """ 369 form = PubSubRequest._findForm(verbElement, NS_PUBSUB_NODE_CONFIG)345 form = data_form.findForm(verbElement, NS_PUBSUB_NODE_CONFIG) 370 346 if form and form.formType == 'submit': 371 347 values = form.getValues() … … 379 355 Parse options out of a request for setting the node configuration. 380 356 """ 381 form = PubSubRequest._findForm(verbElement, NS_PUBSUB_NODE_CONFIG)357 form = data_form.findForm(verbElement, NS_PUBSUB_NODE_CONFIG) 382 358 if form: 383 359 if form.formType == 'submit': … … 438 414 439 415 def _parse_options(self, verbElement): 440 form = PubSubRequest._findForm(verbElement, NS_PUBSUB_SUBSCRIBE_OPTIONS)416 form = data_form.findForm(verbElement, NS_PUBSUB_SUBSCRIBE_OPTIONS) 441 417 if form: 442 418 if form.formType == 'submit':
Note: See TracChangeset
for help on using the changeset viewer.