Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Edmund Lian
Tavis (with apologies to all for the noise, but this is probably of general interest), I wrote: >With one caveat--the call to sys._getframe() has to be from within the servlet. >Importing the code as a function won't work. There's got to be a way to get >around this too... I've figured it out

Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Edmund Lian
To get the equivalent of serverSidePath() in during servlet instantation, I wrote: >In this case, I couldn't take no for an answer, and couldn't sleep until I had a solution. Here it is: > >import sys >absoluteFilename = sys._getframe().f_code.co_filename > >I don't know if using deep magic like

Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Edmund Lian
On 09/12/2002 11:39:13 PM Tavis Rudd wrote: >Unfortunately not. I've run into this before. Making it possible would >require huge changes. In this case, I couldn't take no for an answer, and couldn't sleep until I had a solution. Here it is: import sys absoluteFilename = sys._getframe().f_cod

[Webware-discuss] Re: weakref

2002-09-12 Thread Chris Backas
Mike Orr writes: > Your data would not have weakrefs unless you specifically created them. > Webware may well use weakrefs in its caching system; however, I did a > grep through Webware's source files and did not find "weakref" anywhere. > Another possibility is that you are inheriting from a

Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Tavis Rudd
On September 12, 2002 08:46 pm, Edmund wrote: > On 09/12/2002 11:39:13 PM Tavis Rudd wrote: > >Unfortunately not. I've run into this before. Making it possible would > >require huge changes. > > Hmmm... I'm glad you replied Tavis, because the function was actually > written to make the "file" pa

Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Edmund Lian
On 09/12/2002 11:39:13 PM Tavis Rudd wrote: >Unfortunately not. I've run into this before. Making it possible would >require huge changes. Hmmm... I'm glad you replied Tavis, because the function was actually written to make the "file" parameter used in Cheetah Template creation accept relati

Re: [Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Tavis Rudd
Unfortunately not. I've run into this before. Making it possible would require huge changes. Tavis On September 12, 2002 08:27 pm, Edmund Lian wrote: > I have a version of Page.py that implements a function to calculate the > absolute path to a given file: > > def decodePath(self, file): >

[Webware-discuss] Getting at serverSidePath earlier than awake phase

2002-09-12 Thread Edmund Lian
I have a version of Page.py that implements a function to calculate the absolute path to a given file: def decodePath(self, file): if file[0] == '/': return file else: op = os.path currentDir = op.dirname(self.serverSidePath()) retu

[Webware-discuss] weakref

2002-09-12 Thread Mike Orr
I don't know a lot about weakrefs, but their purpose is to have a cached link to an object that doesn't use any system resources when the object isn't also being used elsewhere. They assume you can reconstruct the original object when needed if the link is dead. Your data would not have weakrefs

RE: [Webware-discuss] Python segfaults under load

2002-09-12 Thread Hancock, David (DHANCOCK)
Nick: I have heard of something called the "global interpreter lock" in Python that sounds like it means only one process can get hold of some critical part of the interpreter at one time. Maybe that's related, maybe I'm uninformed... Probably the latter. As nice as httplib is for benchmarking,

Re: [Webware-discuss] Python segfaults under load

2002-09-12 Thread Nick Murtagh
I wrote: > Hi > > I'm having a problem with Webware 0.7 using mod_webkit, > python 2.0 / 2.1, apache 1.3.22 on a Mandrake 8.0-ish > server. Hmm never mind the problem seems to relate to MySQLdb... Nick --- This sf.net email is sponsored by:

[Webware-discuss] Python segfaults under load

2002-09-12 Thread Nick Murtagh
Hi I'm having a problem with Webware 0.7 using mod_webkit, python 2.0 / 2.1, apache 1.3.22 on a Mandrake 8.0-ish server. I've written a simple benchmarking script that uses httplib to retrieve a page from the server inside an infinite while loop. This works fine. If I run another copy in paralle