On Mon, Sep 10, 2012 at 9:49 PM, Martin Langhoff <martin.langh...@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/ _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel