[pygtk] Async GnomeVFS transfers...

Marcin Lewandowski lists at saepia.net
Mon May 21 17:51:09 WST 2007


Hi,

I know that this is pygtk not gnome list but I hope I find here some 
people that can help me (i'm becoming weird because of gnomevfs).

I try to do something very simple: start asynchronous transfer using 
gnome-vfs and check if all file was downloaded.

Part of code is here:
http://saepia.net/tmp/gnomefvs-async.txt

My test case is that I shut down eth0 when transfer is running to see 
how my code behaves when it encounters connection problems.

I have a few problems/questions:

1. When I change error_mode = gnomevfs.XFER_ERROR_MODE_QUERY to 
error_mode = gnomevfs.XFER_ERROR_MODE_ABORT I cannot rely on

if info.phase == gnomevfs.XFER_PHASE_COMPLETED:

because it asserts also when transfer was aborted. How can I check if 
all file was downloaded with XFER_ERROR_MODE_ABORT?


2. When I use XFER_ERROR_MODE_QUERY (as in the code) gnomevfs seems not 
to be responding for

return gnomevfs.XFER_ERROR_ACTION_ABORT

It looks like indefinite loop, transfer is stalled but it still calls 
progress callback function with status XFER_PROGRESS_STATUS_VFSERROR. I 
still return XFER_ERROR_ACTION_ABORT and so on. Why it doesn't respond 
for what I return?


3. Why info.bytes_copied never reaches info.bytes_total in callback 
function? In my all testcases bytes_copied always was 1024 less than 
bytes_total. I thought that maybe I can rely on that but this is weird also.



Thanks in advance, I'm really getting tired because of gnomevfs

-- 
Marcin


More information about the pygtk mailing list