Stephen Hahn wrote:
> * Michal Pryc <[EMAIL PROTECTED]> [2008-07-18 15:27]:
>> Hello,
>> The webrev for proposed changes for the progress is available at:
>> http://cr.opensolaris.org/~migi/ips_progress_changes/
> 
>   Shouldn't there also be changes in packagemanager.py or src/gui/*.py?
>   The webrev only shows changes to the pkg.client side.

Hello Stephen,

First we want to make all the changes in the pkg.client side so we will 
be able to remove duplicated code from the src/gui/*.py
Those proposals are in small steps, so it is much easier to review and 
describe each functionality which we are adding. Tomorrow I will send 
second proposal which will include canceling (pre/post)execute steps.

Once those bits will be in the IPS we will start working on changing IPS 
GUI to make use of them and remove duplicated code.


> 
>> It would be really nice if we could get this request working:
>> http://defect.opensolaris.org/bz/show_bug.cgi?id=2587
> 
>   Interesting.  What would you want the new chunk size to be, typically?
>   How would you adjust it?

The progress which we currently have is moving once each file is being 
downloaded. If the file is heavy ~2Mb and the connection is slow, users 
might think that the application is simply frozen e.g.lines 223,249:
http://cr.opensolaris.org/~migi/ips_progress_changes/src/modules/client/filelist.py.html

The solution for this might be adding chunk like BUFSIZE using urllib. 
This will allow two things, better notification and possibility of 
canceling the operation in the mid-download operation, here is 
conceptual example:


some_stream = urllib.urlopen("URL")
while not finished reading data:
       data = some_stream.read(BUFSIZE)
             if not data:
                   break
             if operation_canceled:
                   raise CancelDownloadException
             output.write(data)
             progress.download_add_progress(BYTES)


In the above example users are able to cancel this operation only when 
the chunk is downloaded, so in case there is connection loss and the 
user wants to cancel operation then the timeout needs to occur to allow 
user to cancel operation.

Ideally would be to have asynchronous download operation, which will 
allow canceling the download operation at any time, here are the examples:

http://effbot.org/zone/effnews-1.htm#asynchronous-http
http://effbot.org/zone/effnews-3.htm#managing-downloads

-- 
best
Michal Pryc
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to