[Zope] Allowing Regular expressions in Python Script

Stefan H. Holek stefan@epy.co.at
Thu, 19 Sep 2002 13:15:06 +0200


I think it goes like this:

 from Products.PythonScripts.Utility import allow_module, allow_type
 import re

 allow_module('re')
 allow_type(type(re.compile('')))
 allow_type(type(re.match('x','x')))

HTH,
Stefan


--On Mittwoch, 18. September 2002 12:54 +0200 Andreas Rippel 
<arippel@informatik.uni-kl.de> wrote:

> Hi,
>
> for using regular expressions in python script (import re ...)
> I used the explained method via a directory in lib/python/Products
> see
>  > cat  lib/python/Products/GlobalModules/__init__.py
># Global module assertions for Python scripts
> from Products.PythonScripts.Utility import allow_module
>
> allow_module('base64')
> allow_module('re')
> allow_module('time')
>
> I can use all time attributes and methods, but when I'm calling e.g.
> re.compile("a").match("ba", 1) in the script I get a authentification
> window from zope. This happens for different plattforms.
> Any idea what additional rights are necessary or whats happening at that
> point?
>
--
Those who write software only for pay should go hurt some other field.
/Erik Naggum/