[pygtk] Progressive reading in GIO

Jamie Bliss astronouth7303 at gmail.com
Tue Sep 13 00:58:44 WST 2011


I recently ported Cropper from gnomevfs to gio. While I like many of
the changes made between them, one thing that appears to be starkly
missing from gio is the ability to read progressively.

Under gnomevfs, I could get data in chunks as it was read, so I could
feed it to PixbufLoader in chunks. In this way, I didn't have to wait
for the entirety of a file before starting to load it.

Under gio, I do not seem to be able to do this. From an interface
standpoint, I would think I could use the stream from File.read() to
do it, but I don't think it returns until the file is completely
downloaded. ATM, I'm using read_async() instead, but it seems to do
pretty much the same thing.

Can anyone clarify this for me?

Thanks,
Jamie


More information about the pygtk mailing list