comparison idavoll/backend.py @ 174:79d451d186b1

Send out node deletion notifications.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 09 Apr 2008 11:48:38 +0000
parents 9bfb00edd0cc
children 07114105885a
comparison
equal deleted inserted replaced
173:246911bcb699 174:79d451d186b1
383 self.hideNodes = False 383 self.hideNodes = False
384 384
385 self.pubSubFeatures = self._getPubSubFeatures() 385 self.pubSubFeatures = self._getPubSubFeatures()
386 386
387 self.backend.register_notifier(self._notify) 387 self.backend.register_notifier(self._notify)
388 self.backend.register_pre_delete(self._pre_delete)
388 389
389 def _getPubSubFeatures(self): 390 def _getPubSubFeatures(self):
390 features = [ 391 features = [
391 "config-node", 392 "config-node",
392 "create-nodes", 393 "create-nodes",
424 d = self.backend.get_notification_list(nodeIdentifier, items) 425 d = self.backend.get_notification_list(nodeIdentifier, items)
425 d.addCallback(lambda notifications: self.notifyPublish(self.serviceJID, 426 d.addCallback(lambda notifications: self.notifyPublish(self.serviceJID,
426 nodeIdentifier, 427 nodeIdentifier,
427 notifications)) 428 notifications))
428 429
430 def _pre_delete(self, nodeIdentifier):
431 d = self.backend.get_subscribers(nodeIdentifier)
432 d.addCallback(lambda subscribers: self.notifyDelete(self.serviceJID,
433 nodeIdentifier,
434 subscribers))
435 return d
436
429 def _mapErrors(self, failure): 437 def _mapErrors(self, failure):
430 e = failure.trap(*self._errorMap.keys()) 438 e = failure.trap(*self._errorMap.keys())
431 439
432 condition, pubsubCondition, feature = self._errorMap[e] 440 condition, pubsubCondition, feature = self._errorMap[e]
433 msg = failure.value.msg 441 msg = failure.value.msg