class MyFactory( Factory): p = None parser = None def buildProtocol( self, addr): self.p = self.protocol() self.p.factory = self self.parser = Parser( self) return self.p def write( self, data): self.p.write( data) def send( self, data): self.p.send( data) def parseTriggers( self, data): self.parser.parseTriggers( data) def parseAliases( self, data): self.parser.parseAliases( data)
def buildProtocol( self, addr): self.p = self.protocol() self.p.factory = self self.parser = Parser( self) return self.p