Johan Dahlin | 14 Nov 11:14
Favicon

Fwd: pygobject: Updating mount information outside of the glib event loop?

---------- Forwarded message ----------
From: Stefan Farestam <stefan <at> farestam.net>
Date: Thu, Nov 13, 2008 at 9:21 PM
Subject: pygobject: Updating mount information outside of the glib event loop?
To: johan <at> gnome.org

Hi Johan,

I'm attempting to hack up a small fuse-based automounter in python for
gvfs and ran across the python gio library. Very nice! However, the
fuse library has its own event loop and it seems like information
about mounts in gio is not updated unless the glib event loop is
executed. Can I mix the two event loops somehow, or is there any other
way to get around this and force the mount information to become
updated?

As an example, here is a code snippet that I use to list active mounts:

-----------------------------------------------
#!/usr/bin/python

import gio, time

while [ 1 ]:
 volume_monitor=gio.volume_monitor_get()
 mounts = volume_monitor.get_mounts()
 for mount in mounts:
     print mount.get_name()
 time.sleep(1)
-----------------------------------------------
(Continue reading)


Gmane