On Sat, Mar 28, 2009 at 2:32 AM, Enrique Samson Jr. <enriqu...@gmail.com> wrote: > On Wed, 2009-03-25 at 11:00 +0100, Pet wrote: >> > Hi, >> > >> > thanks for example! >> > In that way, I'm getting error: >> > >> > exceptions.AttributeError: MyProtocol instance has no attribute 'factory' >> > >> > How can MyProtocol access self.factory.dbcon? >> >> Ups! I didn't followed exactly your example and tried to access >> self.factory.dbcon in __init__ of MyProtocol, so I've got an error. >> If I access self.factory.dbcon in lineReceived it seems to work. But I >> don't really understand, why can I access factory in lineReceived and >> not in __init__. >> >> Pet > > Hi Pet, > > You can simply look into the buildProtocol code of Factory for an > explanation. This is the part where your protocol gets to be > instantiated.
thanks for a hint. I'll look into that closer. Twisted is like a black box for me right now. However, I've managed to write a useful Client-Server App :) > > > HTH, > > Enrique > > > > _______________________________________________ > Twisted-Python mailing list > Twisted-Python@twistedmatrix.com > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python > _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python