[Twisted-web] HTTPChannel class attributes

A Desai ardesai at yahoo.com
Sat Oct 6 17:04:35 EDT 2012


I realize it does become an instance variable as soon as it is assigned a value, hence I was perplexed as to why it did not have the intended effect.  Thanks for pointing out that the name is mangled.  That clarifies it!  I forgot about name mangling (although I did realize attrs starting with '_' are intended to be implementation detail private).  

In any case, I do not replicate the logic of allContentReceived () anymore.  Instead, I just call the base class method in my derived class.  

I had to have a derived class because the following line throws an exception:
    req = self.requests[-1]
because of my special handing of the request connection (the req is gone by the time allContentReceived() gets called).  What is my special handling?  I tie up the request using producer/consumer to some other resource before the entire content is received.

So for now I am fine with:
DerivedClass::allContentReceived(self):
    try:
        http.HTTPChannel.allContentReceived(self)
    except Exception, e:
        pass

Speaking of derived classes, ... I will pose a related question on a new thread ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20121006/1575101f/attachment.htm 


More information about the Twisted-web mailing list