[Sugar-devel] [PATCH Browse] Cancel a download if space is very tight SL #394

Manuel Kaufmann humitos at gmail.com
Tue Sep 11 09:01:18 EDT 2012


On Mon, Sep 10, 2012 at 9:49 PM, Martin Langhoff
<martin.langhoff at gmail.com> wrote:
> Here, get the content-length... and compare with the free bytes (plus
> some padding, say, 15%). Maybe we still want to preserve a minimum
> disk space. For example: don't let a download put you below 50MB or
> 10MB free -- in that case do the multiplication in a constant
> definition.
>
> MIN_DISKFREE_AFTER_DOWNLOAD = 50 * 1024 * 1024

If we are going to use this approach, I have to change the logic about
"where" I should check this. Now, I'm checking this every time that
the "progress"[1] changes but I think we should use "total-size"[2] to
get the "Content-Length" in Download.__init__() and decide there what
to do. I mean, decide whether cancel or not before starting the
download.

What do you say?

[1] http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitdownload.html#WebKitDownload--progress
[2] http://webkitgtk.org/reference/webkitgtk/stable/webkitgtk-webkitdownload.html#WebKitDownload--total-size

-- 
Kaufmann Manuel
Blog: http://humitos.wordpress.com/
Porfolio: http://fotos.mkaufmann.com.ar/
PyAr: http://www.python.com.ar/


More information about the Sugar-devel mailing list