I'm attempting to implement a recursive directory monitor. My approach is
basically to take the gio.FileMonitor returned by the method
gio.File.monitor_directory(), connect to the "changed" signal, and add or
remove monitors on create/delete events for subdirectories.

The problem I'm having is in creating it in the first place. Ideally I'd
like to just extend the gio.FileMonitor class, but since it's never
explicitly initialised in user code (but somewhere in
gio.File.monitor_directory() ) there's no point in just declaring a subclass
— where would I actually create an instance? The other option is to define a
new GObject with the same "changed" signal. This keeps the directory monitor
as a member variable, connects to its "changed" signal and does all the
recursive logic.

The latter approach isn't actually a bad idea, although it involves the
extra typical GObject boilerplate... But besides that, I was curious as to
whether there's a way to "slot in" my subclass so that it gets used instead
of the gio.FileMonitor.

Finally, does anyone know if the event gio.FILE_MONITOR_EVENT_MOVED is ever
actually used? All of the testing I've done shows a move or rename as a a
pair of gio.FILE_MONITOR_EVENT_DELETED/gio.FILE_MONITOR_EVENT_CREATED
events.

Cheers,
Jason
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to