def listen(self):
        '''Listen for events'''
        for message in Listener.listen(self):
            logger.debug('Message: %s', message)
            # Strip off the 'namespace' from the channel
            channel = message['channel'][len(self.namespace):]
            func = self._callbacks.get(channel)
            if func:
                func(message['data'])
def listen ( self ) : for message in Listener . listen ( self ) : logger . debug ( 'Message: %s' , message ) channel = message [ 'channel' ] [ len ( self . namespace ) : ] func = self . _callbacks . get ( channel ) if func : func ( message [ 'data' ] )
Listen for events