(self, publisher=None, out=sys.stdout)
If publisher is not None, then all self's methods
        are subscribed to the 'pubsub.*' topics by using
        publisher.subscribe().
If publisher is not None, then all self's methods
        are subscribed to the 'pubsub.*' topics by using
        publisher.subscribe().
If publisher is not None then all self s methods are subscribed to the pubsub . * topics by using publisher . subscribe () .
def __init__(self, publisher=None, out=sys.stdout):
        """If publisher is not None, then all self's methods
        are subscribed to the 'pubsub.*' topics by using
        publisher.subscribe(). """
        self._out = out
        self.lastMsg = ''
        self.lastTopic = ''
        self.lastLogTopic = ''
        self.counts = dict(send=0, sub=0, unsub=0, delt=0, newt=0, dead=0, all=0)

        if publisher is not None:
            pub = publisher
            pub.subscribe(self.subscribe, 'pubsub.subscribe')
            pub.subscribe(self.newTopic, 'pubsub.newTopic')
            pub.subscribe(self.delTopic, 'pubsub.delTopic')
            pub.subscribe(self.unsubscribe, 'pubsub.unsubscribe')
            pub.subscribe(self.sendMessage, 'pubsub.sendMessage')
            pub.subscribe(self.deadListener, 'pubsub.deadListener')
            pub.subscribe(self.all, 'pubsub')
def __init__ ( self , publisher = None , out = sys . stdout ) : self . _out = out self . lastMsg = '' self . lastTopic = '' self . lastLogTopic = '' self . counts = dict ( send = 0 , sub = 0 , unsub = 0 , delt = 0 , newt = 0 , dead = 0 , all = 0 ) if publisher is not None : pub = publisher pub . subscribe ( self . subscribe , 'pubsub.subscribe' ) pub . subscribe ( self . newTopic , 'pubsub.newTopic' ) pub . subscribe ( self . delTopic , 'pubsub.delTopic' ) pub . subscribe ( self . unsubscribe , 'pubsub.unsubscribe' ) pub . subscribe ( self . sendMessage , 'pubsub.sendMessage' ) pub . subscribe ( self . deadListener , 'pubsub.deadListener' ) pub . subscribe ( self . all , 'pubsub' )