[Zope-dev] Access to extra modules in Python Scripts

Dyon Balding dyon@hiringtools.com
Wed, 20 Jun 2001 12:24:20 -0700


I wanted to make the re module accessible to Python Scripts on my site.

The instructions in the README.txt in the product directory specify that
you should place:

from Products.PythonScripts.Utility import allow_module
allow_module('re')

in a product __init__.py.  This appears to work fine for basic re
functions, however I wish to use the returned re.MatchObject objects,
and these raise an Unauthorized exception when methods are called. 
Reverting to the old __allow_access_to_unprotected_subobjects__ on re,
re.MatchObjects and re.RegexObjects appears to work however.

How is one supposed to expose that functionality to Python Scripts using
the new security features?  In the Utility.py is an allow_class method
as well, but I couldn't work out if that was what I needed.

thanks
-d

-- 
| Dyon Balding . Software Engineer . HiringTools.Monster.com
|   dyon@hiringtools.com . +1 415 288 3375