GNOME Bugzilla – Bug 320127
[patch] Please provide python bindings for the reaper object
Last modified: 2010-03-16 21:02:26 UTC
Please provide python bindings for the reaper object
Created attachment 54016 [details] [review] patch that adds access to the reaper
Please do, latest ontv (2.6.0) uses it !
Created attachment 84635 [details] [review] newer patch
Wibble. I was intending on killing VteReaper at some time since it's a large wrapper for g_child_watch_add_full(), which is available via pygobject. Hmm, skimming ontv, it looks like it prefers connecting to the reaper's child-exited signal instead of the terminal's child-exited signal. And could be swapped over except that __grabber_command_exited uses the exit status, which is sadly lacking from the terminal child-exited signal. [But can be made available via a new getter.] However, what I guess might be more useful would be a vte_terminal_spawn_command(vte, flags, argv, env, on_child_exit_cb).
Well, the patch was intended for gdebi IIRC. Maybe the ubuntu and debian people know more about this software than me.
I used the terminal's child-exited signal at first but switched over to the reaper because I needed the exit status as you noted (looked at GDebi). A vte_terminal_spawn_command sounds like a good plan Chris if the exit status can be made availible somehow.
I wouldn't mind switching my code in gdebi and update-manager to g_child_watch_add_full(). But it seems to be not working currently with forkpty() (that is what we use to spawn dpkg). My child_exited function is not called. I'm happy to attach my testcode is someone is interessted (very simple, just exchanged vte.reaper_get(); vte.reaper.connect() with gobject.child_watch_add(pid, self.child_exited))
Re comment 7: There's now a way to get the child's exit status from the child-exited signal (see bug 509204). Since the reaper is to be removed (bug 112172), I think we should WONTFIX this bug.
Agreed. If someone want to do the suggested spawn_command(), open a new bug with patch.