[Zope] Zip za Zope (CMF or Plone folder objects)

David Pratt fairwinds at eastlink.ca
Thu Dec 2 20:30:04 EST 2004


Hi.  I would like to zip folder content in a couple of different ways 
in CMF and Plone:

1) zip in place (zip file made inside folder)
2) zip on filesystem (for email with link to download on apache)

I believe this is possible using an external method with the StringIO 
and zipfile modules.  I can't really find anything other than 
references to the zipfile module.  Has anyone got something like this 
working in CMF or Plone before I begin spending time on this?

I guess the big thing for me is getting a handle on the files.  My 
thinking is to make a python script to get the contents of the current 
folder (and put this in my skin along with changes for links in my 
folder view templates), make a dictionary so I have the object id and 
data for each object and pass it to the external method.  Then create 
an empty string file object using StringIO and build the content of the 
zip file by iterating over the object ids and data from the dictionary 
I passed. Once I get the content of the zip file together, the other 
thing is to write it into the folder I obtained the data from. I want 
to have another version that would write it into an apache directory 
and then send the user an email with a download link. Is this a 
reasonable way to go or is there something better?

Regards,
David








More information about the Zope mailing list