Ignore:
Timestamp:
Feb 25, 2010, 10:14:57 AM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Service Discovery fixes for PubSubService?.

  • PubSubService? now properly implements IDisco.
  • Invalid returned values or exceptions raised by getInfo calls on PubSubResource? instances are now logged and ignored.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r87 r88  
    10121012    """
    10131013
    1014     implements(IPubSubService)
     1014    implements(IPubSubService, disco.IDisco)
    10151015
    10161016    iqHandlers = {
     
    10581058
    10591059
    1060     def getDiscoInfo(self, requestor, target, nodeIdentifier):
    1061         def toInfo(nodeInfo, info):
     1060    def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
     1061        def toInfo(nodeInfo):
    10621062            if not nodeInfo:
    1063                 return info
     1063                return
    10641064
    10651065            (nodeType, metaData) = nodeInfo['type'], nodeInfo['meta-data']
     
    10811081                info.append(form)
    10821082
    1083             return info
     1083            return
    10841084
    10851085        info = []
     
    11071107
    11081108        d = defer.maybeDeferred(getInfo, requestor, target, nodeIdentifier or '')
    1109         d.addCallback(toInfo, info)
     1109        d.addCallback(toInfo)
    11101110        d.addErrback(log.err)
     1111        d.addCallback(lambda _: info)
    11111112        return d
    11121113
    11131114
    1114     def getDiscoItems(self, requestor, target, nodeIdentifier):
     1115    def getDiscoItems(self, requestor, target, nodeIdentifier=''):
    11151116        if self.hideNodes:
    11161117            d = defer.succeed([])
Note: See TracChangeset for help on using the changeset viewer.