Re: Making speech-dispatcher python API support asynchronous socket communication (long)

2008-06-23 Thread Tomeu Vizoso
Hi Hynek, this summarizes pretty well my understanding of the issue. Indeed, OLPC is in the process of updating from F-7 to F-9, and in the later, python ships with a patch that addresses this issue. Not sure about pygobject2 and pygtk2, though. So Hemant, perhaps you would like to try an

Re: Making speech-dispatcher python API support asynchronous socket communication (long)

2008-06-23 Thread Hemant Goyal
Hi all, Great thanks all for the feedback and detailed discussions about this problem. I'll wait before modifying the API for a while in such a scenario. @Tomeu : Okay thanks, I'll get back to you once I try what you've told. Best, Hemant On Mon, Jun 23, 2008 at 3:25 PM, Tomeu Vizoso [EMAIL

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-23 Thread Hynek Hanke
When the handshaking is taking place the gtk mainloop has not yet started and hence we cannot rely on the event generated by gobject to read data off the socket. And if this handshaking does not take place the API implementation blocks the entire process thus leading to a deadlock. Now I

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-22 Thread Tomeu Vizoso
On Fri, Jun 20, 2008 at 6:42 PM, Tomas Cerha [EMAIL PROTECTED] wrote: Hynek Hanke wrote: It seems to me a clearer solution to just let the speechd SSIP bindings do their work in their own thread than to extract part of the internals into your program (the socket selects). Yes, this would

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-22 Thread Tomas Cerha
Hemant Goyal wrote: Hmmm, would this mean that if I got a WORD_SPOKEN event notification then the callback to be executed for this event will be executed immediately? Well, technically not really, but practically for the purpose of updating the user interface it can be considered immediate.

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-21 Thread Hemant Goyal
Hi, Thank you all for your ideas. @Tomeu : I looked into the gobject.idle_add and luckily Tomas has an example for me too :). I will be trying that out next. @Tomas: I was facing a similar problem there and I solved it by passing all callbacks to the gidle thread. All SD communication is

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-21 Thread Hynek Hanke
Hello, Now the main problem: the gobject method does not seem to run the callback to read data from the socket when data is written to the socket. (I tried to test the socket monitoring method in a separate script and it worked fine then). If the API implementation is not able to read data

Making speech-dispatcher python API support asynchronous socket communication

2008-06-20 Thread Hemant Goyal
Hi, (This mail might become extremely verbose. Please bear with me) The speech-dispatcher python API can be accessed at: http://cvs.freebsoft.org/repository/speechd/src/python/speechd/client.py?view=markup The client API communicates with the speech server presently in a thread by polling the

Re: Making speech-dispatcher python API support asynchronous socket communication

2008-06-20 Thread Tomeu Vizoso
On Fri, Jun 20, 2008 at 12:08 PM, Hemant Goyal [EMAIL PROTECTED] wrote: When the handshaking is taking place the gtk mainloop has not yet started and hence we cannot rely on the event generated by gobject to read data off the socket. And if this handshaking does not take place the API