HTTPChannel class attributes

A Desai <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
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 ...

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.