Tim McLaughlin wrote:
> 
> Anybody know how I can call  a pythonscript from python?  Currently I can
> call it, but I seem to have no context or security context, because it
> either will not let me access anything or fail with an attribute error in
> the context.  What are the params that I NEED to pass in so that it can do
> its bindings (and if you know how to get them automagically, that would be
> incredible)?
> 
> Tim
> 

The Bindings parent class of PythonScript defines a method 
__render_with_namespace__(namespace) that looks like it grabs the
arguments
and bindings from whatever namespace mapping you provide it and then
executes
the script.

You could also use the _bindAndExec(args, kw, caller_namespace) method
if you want to
also pass arguments from outside the namespace.

Take at looksie at lib/python/Shared/DC/Scripts/Bindings.py for the
source.

-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`------------------>

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to