(self, topic=None, stage=None)
Give this to pub.subscribe() as listener of
        'pubsub.sendMessage' messages.
Give this to pub.subscribe() as listener of
        'pubsub.sendMessage' messages.
Give this to pub . subscribe () as listener of pubsub . sendMessage messages .
def sendMessage(self, topic=None, stage=None):
        """Give this to pub.subscribe() as listener of
        'pubsub.sendMessage' messages. """
        if stage == 'pre':
            msg = '%sSending message of topic "%s"\n'
            msg = msg % (self.prefix, topic.getName())
            self._out.write(msg)
            self.lastTopic = topic.getName()
            self.lastLogTopic = 'pubsub.sendMessage'
            self.lastMsg = msg
            self.counts['send'] += 1
        if stage == 'post':
            msg = "%sSent '%s' message\n"
            msg = msg % (self.prefix, topic.getName())
            self._out.write(msg)
def sendMessage ( self , topic = None , stage = None ) : if stage == 'pre' : msg = '%sSending message of topic "%s"\n' msg = msg % ( self . prefix , topic . getName ( ) ) self . _out . write ( msg ) self . lastTopic = topic . getName ( ) self . lastLogTopic = 'pubsub.sendMessage' self . lastMsg = msg self . counts [ 'send' ] += 1 if stage == 'post' : msg = "%sSent '%s' message\n" msg = msg % ( self . prefix , topic . getName ( ) ) self . _out . write ( msg )