[Twisted-Python] Patch Ideas

Tom 'Korpios' Tobin korpios at korpios.com
Wed May 14 10:14:37 EDT 2003


I'm fairly new to Twisted, and I had a couple of patch ideas I wanted to run by before submitting:


1) Making twisted.web.distrib play nicely with twisted.web.vhost

As things currently stand, these two refuse to cooperate by default; for example, defining a vhost that points to a ResourceSubscription will fail.  Fixing it only takes two small changes to twisted.web.distrib (one each to ResourceSubscription and ResourcePublisher), and doesn't appear to break anything.


2) Adding getSessionPassive to twisted.web.server.Request

The default behavior of getSession is to check for an existing session, and drop a session cookie on the client if none exists.  There are many potential cases where this is not desirable; for example, one may have administration options blended into the normal web interface which appear if one is logged in, yet one does not want to drop a session cookie on every client who comes by.  getSessionPassive checks for an existing session or a session cookie; however, if no session or session cookie exists, it does not drop one, opting to return the session's default state as None instead.


Would there be any reason not to add these functionalities?  If not, I'll submit patches here.  :)


Tom "Korpios" Tobin
korpios at korpios.com





More information about the Twisted-Python mailing list