Mercurial > libervia-backend
comparison src/tmp/wokkel/pubsub.py @ 1771:b77dc676a4df
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 | a125b11af711 |
children | 666ab06a9d81 |
comparison
equal
deleted
inserted
replaced
1770:f525c272fd6d | 1771:b77dc676a4df |
---|---|
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, |