I reckon this must be a FAQ but I can't seem to find a sensible answer anywhere. I'm getting a constant error of: Error Type: ImportError Error Value: import of "Shared.AppleScript.test" is unauthorized All I'm trying to do is import a trivial module from (zope/lib/python/)Shared/AppleScript/test into a PythonScript in Zope. Longer term I want to use a standard module which Zope will not give me access to (os - so I sort of understand this) but at the mo I've stripped the function down to just returning a string in order to get things to work - except it's not. Can I not import shared modules into an (internal top Zope) PythonScript? Please, help and pointers to appropriate documentation would be much appreciated. For now I give up! TIA Simon Forster _____________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247 _____________________________________________________
There is no such thing as "shared modules". Python Scripts only have a number of "safe" modules available to them - read zope/lib/python/Products/PythonScripts/README.txt to see how you can easily make more modules available to Python Scripts. -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za * Simon Forster <simon-lists@ldml.com> [2004-08-05 22:04]:
I reckon this must be a FAQ but I can't seem to find a sensible answer anywhere. I'm getting a constant error of:
Error Type: ImportError Error Value: import of "Shared.AppleScript.test" is unauthorized
All I'm trying to do is import a trivial module from (zope/lib/python/)Shared/AppleScript/test into a PythonScript in Zope. Longer term I want to use a standard module which Zope will not give me access to (os - so I sort of understand this) but at the mo I've stripped the function down to just returning a string in order to get things to work - except it's not.
Can I not import shared modules into an (internal top Zope) PythonScript?
Please, help and pointers to appropriate documentation would be much appreciated.
For now I give up!
TIA
Simon Forster _____________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247 _____________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Thanks to all who replied. Sounds like zope/lib/python/Products/PythonScripts/README.txt is my friend. I'll check this out. Hope you all have a good weekend Simon Forster _____________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247 _____________________________________________________
Imports in through-the-web code are restricted. You can only import modules that have been declared via Zope's security machinery. To make these declarations, here's a little zopelabs recipe. http://www.zopelabs.com/cookbook/1074897091 On Thu, Aug 05, 2004 at 08:08:28PM +0100, Simon Forster wrote:
I reckon this must be a FAQ but I can't seem to find a sensible answer anywhere. I'm getting a constant error of:
Error Type: ImportError Error Value: import of "Shared.AppleScript.test" is unauthorized
All I'm trying to do is import a trivial module from (zope/lib/python/)Shared/AppleScript/test into a PythonScript in Zope. Longer term I want to use a standard module which Zope will not give me access to (os - so I sort of understand this) but at the mo I've stripped the function down to just returning a string in order to get things to work - except it's not.
Can I not import shared modules into an (internal top Zope) PythonScript?
Please, help and pointers to appropriate documentation would be much appreciated.
For now I give up!
TIA
Simon Forster _____________________________________________________ LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247 _____________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Paul Winkler http://www.slinkp.com
--On Donnerstag, 5. August 2004 20:08 Uhr +0100 Simon Forster <simon-lists@ldml.com> wrote:
I reckon this must be a FAQ but I can't seem to find a sensible answer anywhere. I'm getting a constant error of:
-> lib/python/Products/PythonScripts/README.txt -aj
participants (4)
-
Andreas Jung -
Paul Winkler -
Roché Compaan -
Simon Forster