[Sugar-devel] [sugar] Python Zip Library

Tomeu Vizoso tomeu
Tue Nov 25 12:26:48 EST 2008


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
>
>




More information about the Sugar-devel mailing list