After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150251 - g_child_add_watch
g_child_add_watch
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: documentation
2.5.x/2.6.x
Other All
: Normal enhancement
: pygtk-2.6
Assigned To: Gustavo Carneiro
Python bindings maintainers
Depends on: 154827 154828
Blocks:
 
 
Reported: 2004-08-16 11:14 UTC by Gustavo Carneiro
Modified: 2005-09-18 01:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
implement gobject.child_watch_add (3.73 KB, patch)
2004-10-06 18:40 UTC, Gustavo Carneiro
none Details | Review
new version, now works (4.23 KB, patch)
2004-10-06 23:23 UTC, Gustavo Carneiro
none Details | Review
updated patch, added g_spawn_async_with_pipes wrapper (11.14 KB, patch)
2004-10-07 20:48 UTC, Gustavo Carneiro
none Details | Review
document gobject.child_watch_add (3.01 KB, patch)
2005-09-11 23:18 UTC, Gustavo Carneiro
none Details | Review

Description Gustavo Carneiro 2004-08-16 11:14:11 UTC
This is a reminder that we should add a wrapper for this function at the next
opportunity.
No, there is no python equivalent API.  Although the same can be implemented in
python, it is not trivial (though not too complicated either).
Comment 1 Gustavo Carneiro 2004-10-06 18:40:22 UTC
Created attachment 32301 [details] [review]
implement gobject.child_watch_add

It doesn't seem to be working.	 jpe suggested this api probably only works in
conjunction with g_spawn_*, and I suspect he may be right.  So, even though I
said in the past we didn't need to wrap g_spawn_*, now there is a good reason
to do so.
Comment 2 Gustavo Carneiro 2004-10-06 23:23:13 UTC
Created attachment 32310 [details] [review]
new version, now works

OK, I got it working.  It seems to work with g_spawn_*.  However, it is not
reliable for programs that quit very quickly after creation.  In the test, the
child process sleeps for one second, and this way it works.
Comment 3 Gustavo Carneiro 2004-10-06 23:35:48 UTC
"It seems to work with g_spawn_*." --> I meant _without_ g_spawn_*.
Comment 4 Gustavo Carneiro 2004-10-07 20:48:12 UTC
Created attachment 32367 [details] [review]
updated patch, added g_spawn_async_with_pipes wrapper

Unfortunately, even with g_spawn_async the bug remains :-(
I have detected at least two glib bugs already: 1. multiple g_child_watch_add's
don't work; 2. g_child_watch_add doesn't work if child terminates too quickly.
Comment 5 Gustavo Carneiro 2005-01-07 17:49:30 UTC
I'd like to include this in 2.6, if no one opposes.  Question: do we include the
g_spawn_async_with_pipes wrapper or not?
Comment 6 Gustavo Carneiro 2005-04-17 11:29:37 UTC
It would be nice to document these new functions:
 - gobject.child_watch_add
 - gobject.sapwn_async
Comment 7 Gustavo Carneiro 2005-09-11 23:18:38 UTC
Created attachment 52106 [details] [review]
document gobject.child_watch_add
Comment 8 John Finlay 2005-09-18 01:22:42 UTC
docs added 2.8.1 ref with main_depth() and get_current_time()