Garito wrote:
Can I know the execution contexto of an object?

I would like to know if the object is call by ZMI or DTML or Page Templates etc

is it posible?

Perhaps; I am not sure I can see why it would be *desirable*. Given that Scripts, DTMLMethods, etc., try pretty hard to push themselves onto the execution stack just as though they were methods, you could probably introspect the result of calling 'sys._getframe(1)' to figure out what kind of thing called you.

From the Python Cookbook, #14.7:

   >>> def whoami():
   ...     """ Return the name of the calling function.
   ...     """
   ...     import sys
   ...     return sys._getframe(1).f_code.co_name
   >>> def foobar():
   ...     print whoami()
   >>> foobar()

Tres. -- =============================================================== Tres Seaver [EMAIL PROTECTED] Zope Corporation "Zope Dealers"

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to