comparison src/tmp/wokkel/pubsub.py @ 2205:582359de7268

tmp(wokkel/pubsub): removed affiliations attribute which was there twice + added missing _render_affiliations
author Goffi <goffi@goffi.org>
date Sun, 26 Mar 2017 16:57:53 +0200
parents 7f91b894bfdf
children 893030a9d351
comparison
equal deleted inserted replaced
2204:afc703419186 2205:582359de7268
285 @type affiliations: C{dict} 285 @type affiliations: C{dict}
286 """ 286 """
287 287
288 verb = None 288 verb = None
289 289
290 affiliations = None
291 items = None 290 items = None
292 itemIdentifiers = None 291 itemIdentifiers = None
293 maxItems = None 292 maxItems = None
294 nodeIdentifier = None 293 nodeIdentifier = None
295 nodeType = None 294 nodeType = None
613 except KeyError: 612 except KeyError:
614 raise BadRequest(text='Missing affiliation attribute') 613 raise BadRequest(text='Missing affiliation attribute')
615 614
616 self.affiliations[entity] = affiliation 615 self.affiliations[entity] = affiliation
617 616
617 def _render_affiliations(self, verbElement):
618 for entity, affiliation in self.affiliations.iteritems():
619 affiliationElement = verbElement.addElement((NS_PUBSUB_OWNER, 'affiliation'))
620 affiliationElement['jid'] = entity.full()
621 affiliationElement['affiliation'] = affiliation
618 622
619 def _parse_notify(self, verbElement): 623 def _parse_notify(self, verbElement):
620 value = verbElement.getAttribute('notify') 624 value = verbElement.getAttribute('notify')
621 625
622 if value: 626 if value: