[Twisted-Python] LivePage patch? - was (LivePage CACHING Problem)

Working with fzZzy on #divmod, I made the following change to my local twisted/web/woven/flashconduit.py to make LivePage work for me. I'm using guard sessions (which appear to not be supported by the current code) so in my case the sessions are stored on the SessionWrapper. I really don't know squat about the way the code should be, so hopefully someone else can take a look at this and apply a real patch. I'd gladly do the real thing, but it would take me a *lot* longer to do. :-) Thanks. -Justin --- flashconduit.py.orig 2003-11-17 13:18:37.000000000 -0600 +++ flashconduit.py 2003-11-17 13:18:43.000000000 -0600 @@ -16,7 +16,8 @@ #self.lp.unhookOutputConduit() def lineReceived(self, line): - session = self.factory.site.getSession(line) + #session = self.factory.site.getSession(line) + session = self.factory.site.resource.sessions[line] self.lp = lp = session.getComponent(interfaces.IWovenLivePage) lp.hookupOutputConduit(self) ----- Original message ----- From: "Justin Johnson" <justinjohnson@fastmail.fm> To: "Twisted-Python" <twisted-python@twistedmatrix.com> Date: Thu, 13 Nov 2003 11:19:09 -0600 Subject: Re: [Twisted-Python] LivePage CACHING Problem I found the following post that looks similar to my problem. http://twistedmatrix.com/pipermail/twisted-python/2003-May/004170.html But since I have my own tap, I copied the code from web/tap.py into my code to start up the FlashConduitFactory. It starts up, but I get the following errors. Is this a bug? Any ideas what I'm doing wrong? 2003/11/13 11:08 CST [twisted.web.woven.flashconduit.FlashConduitFactory] connection with flash movie opened 2003/11/13 11:08 CST [FlashConduit,3,xxx.xxx.xxx.xxx] Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/twisted/internet/default.py", line 501, in doSelect _logrun(selectable, _drdw, selectable, method, dict) File "/usr/local/lib/python2.3/site-packages/twisted/python/log.py", line 65, in callWithLogger callWithContext({"system": lp}, func, *args, **kw) File "/usr/local/lib/python2.3/site-packages/twisted/python/log.py", line 52, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/usr/local/lib/python2.3/site-packages/twisted/python/context.py", line 32, in callWithContext return func(*args,**kw) --- <exception caught here> --- File "/usr/local/lib/python2.3/site-packages/twisted/internet/default.py", line 510, in _doReadOrWrite why = getattr(selectable, method)() File "/usr/local/lib/python2.3/site-packages/twisted/internet/tcp.py", line 250, in doRead return self.protocol.dataReceived(data) File "/usr/local/lib/python2.3/site-packages/twisted/protocols/basic.py", line 223, in dataReceived why = self.lineReceived(line) File "/usr/local/lib/python2.3/site-packages/twisted/web/woven/flashconduit.py", line 19, in lineReceived session = self.factory.site.getSession(line) File "/usr/local/lib/python2.3/site-packages/twisted/web/server.py", line 470, in getSession return self.sessions[uid] exceptions.KeyError: 'd01be6fe334cded345c0b029e29df7ac' 2003/11/13 11:08 CST [FlashConduit,3,xxx.xxx.xxx.xxx] connection lost On Thu, 13 Nov 2003 10:38:59 -0600, "Justin Johnson" <justinjohnson@fastmail.fm> said:
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (1)
-
Justin Johnson