[Zope] display results from external source in zpt

Andreas Jung lists at zopyx.com
Wed Mar 15 07:09:06 EST 2006



--On 15. März 2006 12:03:48 +0000 Dean Hale <dean.hale at sunderland.ac.uk> 
wrote:

>
> Hi Andreas,
>
> Thanks for this i'm trying to use an example below
>
> from urllib import *
> url = 'http://site.ac.uk/cgi-bin/evisiontasks?uid=xxx0xxx&fmt=plain'
> html = urlretrieve(url).read()
>
> however am receiving the error
>
> Error Value: "from urllib import *" is not allowed
>
> i have followed the readme in python/Products/PythonScripts and  created
> a __init__.py file and it has created a __init__.pyc file  once the
> server has restated.
>
> I'm assuming i need to add some extra details to the __init__.py file  is
> this correct and if so have you any ideas what they would be

allow_module() is not a solution for all and everything (consider it a 
hack).
Either write your code as external method or look at TrustedExecutables.

-aj

    -----------------------------------------------------------------------
   -   Andreas Jung            ZOPYX Ltd. & Co KG                        -
  -   E-mail: info at zopyx.com   Web: www.zopyx.com, www.zopyx.de         -
   -----------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20060315/e5f68a68/attachment.bin


More information about the Zope mailing list