How can I know all the functions that are called by Zope?
Hi all! I am trying to make a new Zope product, based on LocalFS, so I am trying to change the source code of LocalFS. But in my product, I need to know who is the authenticated user when someone tries to read a file in the local filesystem by writing its URL. The problem is that if I ask UserManager in any function in the source of LocalFS, it always tells me that it is no one. I think I read somewhere, sometime, that the authenticated user can't be read until the end of traversal. So the changes that I have to make in the source code, have to be made somewhere where the traversal has already finished. I've tried in all the functions of the LocalFS product that are called when someone types the URL of a file in the local filesystem, with no luck. So I have two questions: - Does anybody know all the functions that are called in the Zope sources when someone writes the URL of a file in the local filesystem? - Or else, how can I know all the functions that are called, without having to put traces in all the functions in all the Zope source? Thanks in advance, Igor Leturia
Igor Leturia wrote at 2003-6-19 16:49 +0200:
I am trying to make a new Zope product, based on LocalFS, so I am trying to change the source code of LocalFS. But in my product, I need to know who is the authenticated user when someone tries to read a file in the local filesystem by writing its URL. The problem is that if I ask UserManager in any function in the source of LocalFS, it always tells me that it is no one. I think I read somewhere, sometime, that the authenticated user can't be read until the end of traversal. So the changes that I have to make in the source code, have to be made somewhere where the traversal has already finished.
Apparently, there is a "validation_hook". Look at "Zope/__init__.py". You find the traversal code in "ZPublisher.BaseRequest.BaseRequest.traverse".
... - Does anybody know all the functions that are called in the Zope sources when someone writes the URL of a file in the local filesystem?
You can use a profiler (e.g. "ZopeProfiler" <http://www.dieter.handshake.de/pyprojects/zope> ). However, you will get an incredibly long list.
- Or else, how can I know all the functions that are called, without having to put traces in all the functions in all the Zope source?
A profiler... Dieter
participants (2)
-
Dieter Maurer -
Igor Leturia