[Zope] Python calling files from ancestor directories?

Dieter Maurer dieter@handshake.de
Fri, 14 Jun 2002 20:14:57 +0200


Alec Munro writes:
 > I'm not entirely sure how to add a reply on the mailing list, so I'm
 > mailing you directly.
You reply (to all) in the same way and you reply (to all) to any 
other message.

 > By "call" and "return", I sometimes mean the same thing. Technically, I
 > want my Python script to end with the statement:
 > Return root.nah.someFile()  //Or whatever works
 > 
 > If I get this correctly, you are saying that as long as that there is no
 > other "nah" in any of the parent directories of "cgi",
 > "context.nah.someFile" should return what I need? I remember reading
 > about acquisition, but I wasn't sure if it applied the same way in
 > Python. 
It does.

However, a "file" object itself is not callable. You need to
call its "index_html" method. And it need the correct
arguments (see the embedded Zope documentation: Zope Help -> API Reference -> File)


Dieter