Passing namespace to Python scrict
was: RE: [Zope] how to call an external module from a Python script?
Dieter Maurer
dieter@handshake.de
Tue, 25 Sep 2001 23:46:39 +0200 (CEST)
Reif Peter writes:
> ...
> My script:
>
> ...
> ##bind namespace=namespace
> ...
>
> zone = namespace.zone
> return zone
>
> It is called from a DTML-method where the tag <dtml-var zone> is rendered
> correctly:
>
> ...
> <dtml-var get_status_a>
> ...
>
> Error:
>
> Zope Error
> Zope has encountered an error while publishing this resource.
> Error Type: AttributeError
> Error Value: zone
How is it called?
Implicitly (<dtml-var myPythonScript>) or explicitly?
In the second case, you must pass the namespace yourself!
In the first case, check in the binding tab that
the binding really took place.
PythonScripts are quite picky with the binding comments
at their start. A minor typo and part of the comments
are no longer recognized.
Dieter