[Zope] How to find a function in the zopeSource?

Terry Hancock hancock@earthlink.net
Fri, 30 Nov 2001 06:27:23 -0800


Basically, your best bet is to use a combination of
"find" and "grep", such as:

find . -name "*.py" -exec grep "myfunction" {} \;

This amazingly confusing syntax means "starting from
the current directory ('.'), find files which match
'*.py' (i.e. Python source files), and execute grep on
them each in turn". The contained grep expression
says to search the file for the string "myfunction".

If you are lucky enough to know which directory you
need to search, you can economize a bit and just
use grep:

grep "myfunction" *.py

(which is easier to remember!).

This, of course, is not specific to Zope, but
applies any time you need to find string references
in a large tree of files.

Unfortunately, the fact that you don't know this
probably means you're not using Linux/Unix, so
this may not be so helpful. I have heard that
there is a software package for Windows which
gives you these common utilities, but I don't
know where to get it.  Perhaps someone else could
help you find that. (Maybe just knowing it
exists is helpful?).

Hope this helps,
Terry Hancock


> Message: 45
> From: "Elena Schulz" <elena.schulz@gmx.net>
> To: <zope@zope.org>
> Date: Fri, 30 Nov 2001 10:27:34 +0100
> Subject: [Zope] How to find a function in the zopeSource?
> 
> Dear List,
> 
> can anybody tell me how to find a certain python or dtml-function in the =
> zope source-code? Let=B4s say I am looking for manage_workspace or =
> manage_main? Is there a way to find it in general?
> 
> Thanks a reply,
> 
> Elena




-- 
------------------------------------------------------
Terry Hancock
hancock@anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------