views:

88

answers:

1

I have to mount a WebDav location and wait for the operation to be finished before to proceed (it's a script). So I'm using the library in this way:

location = gio.File("dav://server.bb")
location.mount_enclosing_volume(*args,**kw) # The setup is not much relevant
location.get_path() # Returns None because it's not yet mounted since the call is async

How to wait until the device is mounted?

+1  A: 

To wait for termination, you need to call mount_enclosing_volume_finished with the async-result object returned by mount_enclosing_volume (alternatively, you could pass the latter a callback, if you want to operate asynchronously, but it looks like you want sync-like operations here).

Alex Martelli