Re: [Zope] Getting information about current method

2005-06-20 Thread Peter Bengtsson
> > > > Then I don't know. > > (The application instance is none other than zope itself. ) > > I can honestly not think of a way to extract this information. I've > > even tried setting up a simple example method and I couldn't get hold > > of the zodb name of the external method that is called. >

Re: [Zope] Getting information about current method

2005-06-20 Thread Florent Guillaume
Peter Bengtsson <[EMAIL PROTECTED]> wrote: > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > > It's an application instance wrapped in a list; it seems to be > > identical to self, actually - self.REQUEST['URL'] and > > self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two

Re: [Zope] Getting information about current method

2005-06-18 Thread Dieter Maurer
Peter Bengtsson wrote at 2005-6-17 18:25 +0100: > ... >Then I don't know. >(The application instance is none other than zope itself. ) >I can honestly not think of a way to extract this information. I've >even tried setting up a simple example method and I couldn't get hold >of the zodb name of th

Re: [Zope] Getting information about current method

2005-06-18 Thread Jan-Ole Esleben
Well, thanks anyway for your suggestions; I hope someone else can suggest something; my intuition is that it isn't possible (without going really low level), and that would really be bad... Ole 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>: > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrot

Re: [Zope] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > It's an application instance wrapped in a list; it seems to be > identical to self, actually - self.REQUEST['URL'] and > self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two > REQUESTs are not the identical object (== returns

Re: [Zope] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
It's an application instance wrapped in a list; it seems to be identical to self, actually - self.REQUEST['URL'] and self.REQUEST.PARENTS[0].REQUEST['URL'] are the same. However, the two REQUESTs are not the identical object (== returns False). Ole 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>:

Re: [Zope] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > No, I'm sorry; I only get system paths. > And what about REQUEST.PARENTS? (or is that just the http request) > Ole > > > 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>: > > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > > > Un

Re: [Zope] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
No, I'm sorry; I only get system paths. Ole 2005/6/17, Peter Bengtsson <[EMAIL PROTECTED]>: > On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > > Unforunately, this just gives me the pythonic path to the method; what > > I need for a TALES expression is the ZOPE path - i.e. what I get fro

Re: [Zope] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
Unforunately, this just gives me the pythonic path to the method; what I need for a TALES expression is the ZOPE path - i.e. what I get from the stack frame is ... E:\zope\Extensions\req.py ... but what I need is ... http://localhost:8080/ReqTest ... Ole 2005/6/17, Peter Bengtsson <[EMAIL PROTEC

Re: [Zope] Getting information about current method

2005-06-17 Thread Peter Bengtsson
Then, in your External method, try:: import inspect print inspect.stack()[1] On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > I want to know the name (and path) of the _External Method_ from > inside it. What I _can_ get is the name of the DTML method. > > I want to build generic scaf

Re: [Zope] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
I want to know the name (and path) of the _External Method_ from inside it. What I _can_ get is the name of the DTML method. I want to build generic scaffolding code for functions that conditionally redispatch as asynchronous calls (via ZASync); that part, however, isn't a problem at all - everyth

Re: [Zope] Getting information about current method

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: > Hi! > > I am new to this list and rather new to Zope, so maybe this is a > stupid question; unfortunately I haven't been able to find an answer > to it anywhere: > > is there a generic way to find out from Python code which method has > bee

[Zope] Getting information about current method

2005-06-17 Thread Jan-Ole Esleben
Hi! I am new to this list and rather new to Zope, so maybe this is a stupid question; unfortunately I haven't been able to find an answer to it anywhere: is there a generic way to find out from Python code which method has been called (in other words: find out where the current method is located