Uploading lots of little files to zope
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do? Thanks... Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
--On 20 December 2001 20:31 -0800 Bruce Eckel <Bruce@EckelObjects.com> wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
Thanks...
One of Zanta's Elves made http://www.zope.org/Members/snej/ZipFolder Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/
I installed and tried this -- very nice EXCEPT it creates the files as application/octet-stream rather than DTML-docs. However, I discovered I could still pull off my little include trick with the application/octet-stream files. So it does work! And it's one less step than my approach. Thanks for pointing it out. *********** REPLY SEPARATOR *********** On 12/21/01 at 7:51 AM Paul Browning wrote:
--On 20 December 2001 20:31 -0800 Bruce Eckel <Bruce@EckelObjects.com> wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
Thanks...
One of Zanta's Elves made http://www.zope.org/Members/snej/ZipFolder
Paul
-- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
On Fri, 2001-12-21 at 05:31, Bruce Eckel wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
You could probably use LocalFS, which maps a physical filesystem hierarchy into a Zope folder... Look at zope.org for the URL and informations. Thierry
On Friday 21 December 2001 09:08, Thierry Florac wrote:
On Fri, 2001-12-21 at 05:31, Bruce Eckel wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
You could probably use LocalFS, which maps a physical filesystem hierarchy into a Zope folder... Look at zope.org for the URL and informations.
Or integrate the ./utilities/load_site.py script. Quite a lot has been done to that script lately and I don't remember where the latest script is. Searching the mailinglist you'll find that a man called "Jerome" has created on that has enhancements you might need. It can take a whole folder and upload into a Zope folder. host zope]$ python utilities/load_site.py -u username:password http://host/doc/photos ~/photos/newphotos The enhancement you'll need is support for overwriting. If you want it to overwrite or to leave existing object ids without error. Peter
On Fri, 2001-12-21 at 05:31, Bruce Eckel wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
What's painful about using FTP? (have you tried WebDAV yet?) seb
Never mind. I figured it out -- this is crude and hackish (I'm using fixed file and directory names), but if someone else needs the same answer, it's a start. import zipfile, StringIO def unzip(self): result = '' source = self.restrictedTraverse('book.zip') zf = zipfile.ZipFile(StringIO.StringIO(source.data)) for zi in zf.infolist(): if zi.filename.endswith('/'): continue result += zi.filename + '\n' data = zf.read(zi.filename) name = zi.filename.split('/')[-1] self.book.manage_addProduct['OFSP'].manage_addDTMLDocument(name, title=name, file=data) return result *********** REPLY SEPARATOR *********** On 12/20/01 at 8:31 PM Bruce Eckel wrote:
I now have lots of little files -- thousands -- to upload to Zope every time I do an update of a book. FTP-ing is quite painful. Is there some better solution; is there a way to upload a zip file and then expand it? Or is that something I must write an external method to do?
Thanks...
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
participants (5)
-
Bruce Eckel -
Paul Browning -
Peter Bengtsson -
seb bacon -
Thierry Florac