r"""This is a very useless echo handler..
It is a very minimal example of a handler,
use it wisely ;)"""

def handlerInit(parent,n):
    """Like chatroom, we don't have any particular
    initialization stuff going on, so return an
    empty dict"""
    return {}

class handlerClass:
    """minimal echo handler"""
    def __init__ (self, passInfo):
        self.parent=passInfo["self"]

    def __getattr__ (self,name):
        """inherit stuff from parent"""
        return getattr(self.parent,name)
        
    def log (self,text):
        self.parent.log(text)
    
    def logerror (self,text):
        self.parent.logerror(text)

    def logdebug (self,text):
        self.parent.logdebug(text)
        
    def onConnect (self):
        """do nothing on connect"""
        self.log('CONNECT')

    def onClose (self):
        """do nothing on close"""
        self.log('LOGOUT')

    def onXML (self,doc):
        """return the same stuff we received"""
        self.push(doc.toxml())
r"""This is a very useless echo handler..
It is a very minimal example of a handler,
use it wisely ;)"""

def handlerInit(parent,n):
    """Like chatroom, we don't have any particular
    initialization stuff going on, so return an
    empty dict"""
    return {}

class handlerClass:
    """minimal echo handler"""
    def __init__ (self, passInfo):
        self.parent=passInfo["self"]

    def __getattr__ (self,name):
        """inherit stuff from parent"""
        return getattr(self.parent,name)
        
    def log (self,text):
        self.parent.log(text)
    
    def logerror (self,text):
        self.parent.logerror(text)

    def logdebug (self,text):
        self.parent.logdebug(text)
        
    def onConnect (self):
        """do nothing on connect"""
        self.log('CONNECT')

    def onClose (self):
        """do nothing on close"""
        self.log('LOGOUT')

    def onXML (self,doc):
        """return the same stuff we received"""
        self.push(doc.toxml())
This is a very useless echo handler.. It is a very minimal example of a handler, use it wisely ;) Like chatroom, we don't have any particular     initialization stuff going on, so return an     empty dict minimal echo handler inherit stuff from parent do nothing on connect do nothing on close return the same stuff we received