[Zope] load_site.py and zpt files

Oliver Bleutgen myzope@gmx.net
Fri, 13 Sep 2002 16:02:12 +0200


jbr@FIZ-Karlsruhe.DE wrote:
> Hello,
> 
> I am trying to enhance the load_site.py  script:
> 
> Files with suffix .zpt should be created as a zope page template file.
> 
> 
> I am using Zope 2.5.1 on Unix, I copied  load_site.py  to load_site_fiz.py
> and added the function upload_zpt
> 
> 
> def upload_zpt(object, f):
>     dir, name = os.path.split(f)
>     f=open(f)
> 
> 
>     call(object.manage_addProduct['PageTemplates'].manage_addPageTemplate( id=name, title='', text=f))


Untested:
call(object.manage_addProduct['PageTemplates'].manage_addPageTemplate, 
id=name, title='', text=f)

This is derived from how call(f,*args,**kw) does it's job. It applies 
the arguments for you.


cheers,
oliver