Oliver Bleutgen <myzope@gmx.net> wrote:
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)
No, is not working. I get the same error message: AttributeError: Function instance has no attribute '__getitem__' Do I have to get the folder of object and call manage_addProduct['PageTemplates'].manage_addPageTemplate on that folder ?
This is derived from how call(f,*args,**kw) does it's job. It applies the arguments for you.
cheers, oliver
Juergen Berger