[Zope] External method and import

mikl@club-internet.fr mikl@club-internet.fr
07 May 2000 13:26:35 +0200


Hello,

I have got problem with a try at using a previous Python-CGI dev in Zope (call
it cgi_test.py for example).

To do this, I am writing an external method, that import my cgi_test.py file. I
rewrote my cgi_test.py to return the html page instead of printing the data to
stdin.

But, Zope does seem to like import in the external method. It is able to
import the whole file (from cgi_test import * seems ok) but I it does not find
the main() method when I call it from my external method (cgi.main()).
When I am trying to import this method directly (from cgi_test import main),
it does not work (method main is not found).

Everything work fine when I simply run the external method from Python.

So, I have got two questions:
1- How would you do such a task ? Is my method the best way to do what I need
?

2- What am I missing in Zope external method use ? Is there particular
restriction on import (no pun intended !) ?

Thank you in advance for your help.

-- 
Mickaël