Mercurial > sat_tmp
comparison wokkel/pubsub.py @ 21:54f834e40341
tmp (wokkel/rsm): various improvments:
- restored original tmp.wokkel.pubsub.PubSubService._toResponse_items
- changed arguments order in RSMRequest.__init__ to have most common arguments first
- added __str__ methods
- better parsing/toElement
- better handling of optional elements/attributes (count/index)
- _toResponse_items handler RSM set elements without modifying original pubsub _toResponse_items
- renamed parse to fromElement for coherency
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 05 Jan 2016 23:20:20 +0100 |
parents | fd6957dfa8c6 |
children | 5246a9186b91 |
comparison
equal
deleted
inserted
replaced
20:81f9b53ec7e4 | 21:54f834e40341 |
---|---|
1406 response = domish.Element((NS_PUBSUB, 'pubsub')) | 1406 response = domish.Element((NS_PUBSUB, 'pubsub')) |
1407 items = response.addElement('items') | 1407 items = response.addElement('items') |
1408 items["node"] = request.nodeIdentifier | 1408 items["node"] = request.nodeIdentifier |
1409 | 1409 |
1410 for item in result: | 1410 for item in result: |
1411 if isinstance(item, tuple): | 1411 item.uri = NS_PUBSUB |
1412 # XXX: see sat_pubsub.pgsql_storage.LeafNode.getItemsById return value | 1412 items.addChild(item) |
1413 item = item[0] | |
1414 if item.name == 'item': | |
1415 item.uri = NS_PUBSUB | |
1416 items.addChild(item) | |
1417 | 1413 |
1418 return response | 1414 return response |
1419 | 1415 |
1420 | 1416 |
1421 def _createNotification(self, eventType, service, nodeIdentifier, | 1417 def _createNotification(self, eventType, service, nodeIdentifier, |