[Zope] PythonScript getting at various Python libraries

Gerald Gutierrez pozix@home.com
Fri, 16 Feb 2001 00:30:15 -0800


>
> > I'd like to get access to a bunch of libraries that Python has, like "re"
> > and "time" and "xml" and "md5", etc. What is the standard way that I can
>go about doing this?
> >
>
>Use External (Python) Methods for calling anything that falls under the
>Python Script restrictions. Then call the External Method from Python
>Scripts if still applicable.

Alright. I now have an external method that returns me a reference to the 
md5 module:

def hello(self):
     """ Whatever """
     import md5
     return md5

I can, in my PythonScript, do a

x = context.hello()

and get back a reference to the md5 module, but when I then do a

m = x.new()

which is supposed to get me a new md5 instance, and I hit that 
PythonScript, Zope pops up an authentication box and refuses to let me 
continue. If I call the external method directly through the browser, I get 
a string saying that it is an md5 module.

So what am I doing wrong now?