Mercurial > sat_tmp
comparison wokkel/rsm.py @ 34:213122b92b08 0.6.1 0.6.1.1 0.7-dev cagou refacoring_messages
tmp/wokkel (rsm): fixes elements count (items retrieval with RSM max = 0)
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 18 Mar 2016 09:14:00 +0100 |
parents | c782fb5237f8 |
children |
comparison
equal
deleted
inserted
replaced
33:c0f71fd5ed6b | 34:213122b92b08 |
---|---|
386 request.rsm = rsm_request | 386 request.rsm = rsm_request |
387 | 387 |
388 def cb(iq): | 388 def cb(iq): |
389 items = [] | 389 items = [] |
390 pubsub_elt = iq.pubsub | 390 pubsub_elt = iq.pubsub |
391 for element in pubsub_elt.items.elements(pubsub.NS_PUBSUB, 'item'): | 391 if pubsub_elt.items: |
392 items.append(element) | 392 for element in pubsub_elt.items.elements(pubsub.NS_PUBSUB, 'item'): |
393 items.append(element) | |
393 | 394 |
394 try: | 395 try: |
395 rsm_response = RSMResponse.fromElement(pubsub_elt) | 396 rsm_response = RSMResponse.fromElement(pubsub_elt) |
396 except RSMNotFoundError: | 397 except RSMNotFoundError: |
397 rsm_response = None | 398 rsm_response = None |