Dear Zopers Is it possible to add a PythonScript from a file-system-based Python program? Some things are too complicated for ZPT, but related to the presentation (e.g., writing a cookie with preferences). Therefore, they do not belong in the Python objects, either. A Python Script seems to be the ideal place, but I want to write the script off-line and add it programmatically (not via the ZMI). How is this done? thanks André -- ------------------------------------------------------------------------------ The disclaimer that applies to e-mail from TNO Physics and Electronics Laboratory can be found on: http://www.tno.nl/disclaimer/email.html ------------------------------------------------------------------------------
On Friday 26 March 2004 04:29 am, AP Meyer wrote:
Dear Zopers
Is it possible to add a PythonScript from a file-system-based Python program? Some things are too complicated for ZPT, but related to the presentation (e.g., writing a cookie with preferences). Therefore, they do not belong in the Python objects, either. A Python Script seems to be the ideal place, but I want to write the script off-line and add it programmatically (not via the ZMI). How is this done?
Add something like this to a product method: self.manage_addProduct['PythonScripts'].manage_addPythonScript('script_id') body ="""## Script (Python) "script_name" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=info ##title= ## return something """ self.script_id.write(body) Alec Mitchell
participants (2)
-
Alec Mitchell -
AP Meyer