← Back to team overview

ubuntu-developer-manual team mailing list archive

Re: Developer Manual Sample App

 

On Wed, 2010-06-02 at 16:42 +0100, Stuart Langridge wrote:
> On Wed, 2010-06-02 at 08:05 -0700, Rick Spencer wrote:
> > > I'd suggest using gio for downloads, because that's async and won't
> > > block the UI.
> > > http://www.jonobacon.org/2010/03/15/download-files-async-with-gio-and-python/ is the answer here -- we should encourage people to do as much stuff as possible in an async way (maybe a wrapper library would be good here? http_download(url, callbackfunction) ? )
> > > 
> > Ah yes. I think we should do that next in the chapter. Get going with
> > just some quick code. "Oh! it's easy to do stuff on Ubuntu." Then, "oh,
> > I can even make it async pretty easy".
> 
> Hm, I think the opposite: let's not even tell people about The Wrong Way
> (which blocking the UI is). If gio isn't already as easy as urllib, then
> let's make it easier -- quickly.helpers.fetch_url(), perhaps?
It's not "the wrong way". It's a fine way to do it. It is simple,
direct, few lines of code, and few bugs. For some cases gio is better
because of the blocking. In this case, it adds a bit to start up time,
but not much, identi.ca is fast, and the documents are small. 

Also, it's better to not show the window, than to show it all crippled
and weird while it is waiting for data, so then when using gio you need
to add some feedback that the app is working, and then turn off that
feedback, etc...

In terms of adding helpers to quickly, I think something in
quickly-widgets might suit, like a download helper progress bar, or
such.

Cheers, Rick





References