[Sugar-devel] [sugar] Python Zip Library

Nolan Hughes nolan.e.hughes at gmail.com
Tue Nov 25 14:30:32 EST 2008


Tomeu,
I think we're doing okay with the zipping. It turns out, the problem had to
do with the UTF-8 vs UTF-16 file name encoding we passed to the zip library
function. After lots of debugging we discovered that error and since then
everything has been moving along! We're now playing with extraction and
changing the icon used for packed/unpacked bundles.
Nolan


On Tue, Nov 25, 2008 at 12:26 PM, Tomeu Vizoso <tomeu at tomeuvizoso.net>wrote:

> Hi Nolan,
>
> how is work going? Managed to get that issue solved with Emiliano's hint?
>
> Regards,
>
> Tomeu
>
> On Wed, Nov 19, 2008 at 12:57 PM, Emiliano Pastorino
> <epastorino at plan.ceibal.edu.uy> wrote:
> > Maybe this helps:
> >
> http://www.python.org/doc/2.5/tut/node13.html#SECTION0013400000000000000000
> > It's a multi threading example using zipfile and threading modules
> >
> > On Tue, Nov 18, 2008 at 5:46 PM, Nolan Hughes <nolan.e.hughes at gmail.com>
> > wrote:
> >>
> >> I'm part of team developing the Bundle Activity which will handle zip
> (and
> >> other) archives and have run into a problem with the Zip library in
> Python.
> >> We are currently trying to zip a list of files, and then have the
> program
> >> perform other operations with the resulting zip file. The problem is
> that
> >> Python seems to run asynchronously, so the program execution skips the
> zip
> >> file completion and goes on to the next instructions (which is NOT what
> we
> >> want). In other words, the instructions that handle the resulting zip
> file
> >> get run before the zip file is completely finished. Our code looks like:
> >>
> >> myZip = zipfile.ZipFile(file_name, 'w')
> >> try:
> >>    for a_file in file_list:
> >>      myZip.write(a_file)
> >> finally:
> >>   myZip.close()
> >>
> >> # zip handling instructions
> >> shutil.copy(file_name, journal_location)
> >> # ... put the zip file in the journal ...
> >> ....
> >>
> >> What can we do to have this work?
> >>
> >> Thanks,
> >>
> >> Nolan
> >>
> >>
> >>
> >> _______________________________________________
> >> Sugar mailing list
> >> Sugar at lists.laptop.org
> >> http://lists.laptop.org/listinfo/sugar
> >>
> >
> >
> >
> > --
> > Emiliano Pastorino
> > LATU - Plan Ceibal
> > Av. Italia 6201 CP: 11500, Montevideo, Uruguay
> > Tel: (598 2) 601 3724 int.: 469
> >
> > _______________________________________________
> > Sugar mailing list
> > Sugar at lists.laptop.org
> > http://lists.laptop.org/listinfo/sugar
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20081125/82235bee/attachment-0002.htm 


More information about the Sugar-devel mailing list