comparison src/tmp/wokkel/rsm.py @ 1768:7debf3a4bf14

tmp (rsm): removed useless cast
author Goffi <goffi@goffi.org>
date Sun, 03 Jan 2016 18:36:41 +0100
parents 30ba7cac1dd2
children b77dc676a4df
comparison
equal deleted inserted replaced
1767:8c7450bd9335 1768:7debf3a4bf14
28 28
29 import pubsub 29 import pubsub
30 import copy 30 import copy
31 31
32 32
33 # RSM namespace
34 NS_RSM = 'http://jabber.org/protocol/rsm' 33 NS_RSM = 'http://jabber.org/protocol/rsm'
35 34
36 35
37 class RSMError(Exception): 36 class RSMError(Exception):
38 """ 37 """
97 set_elt = element.elements(NS_RSM, 'set').next() 96 set_elt = element.elements(NS_RSM, 'set').next()
98 except StopIteration: 97 except StopIteration:
99 raise RSMNotFoundError() 98 raise RSMNotFoundError()
100 99
101 request = RSMRequest() 100 request = RSMRequest()
102 for elt in list(set_elt.elements()): 101 for elt in set_elt.elements():
103 if elt.name in ('before', 'after'): 102 if elt.name in ('before', 'after'):
104 setattr(request, elt.name, ''.join(elt.children)) 103 setattr(request, elt.name, ''.join(elt.children))
105 elif elt.name in ('max', 'index'): 104 elif elt.name in ('max', 'index'):
106 setattr(request, elt.name, int(''.join(elt.children))) 105 setattr(request, elt.name, int(''.join(elt.children)))
107 106