[Twisted-Python] wxreactor, serialport, and Windows
I have some twisted code that supports forwarding serial port data to a tcp socket. The code needs to run on Windows, so I'm using the win32eventreactor, as is required by the twisted.internet.serialport code. Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor, unfortunately, since we don't yet have a way to make it pluggable.
On Wed, 07 Feb 2007 09:55:58 -0500, Itamar Shtull-Trauring <itamar@itamarst.org> wrote:
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor, unfortunately, since we don't yet have a way to make it pluggable.
Another path would be to continue to use win32er and use wxPython in a second thread without getting wxreactor involved at all. A third path would be to contribute some development time to Twisted to provide a better, supported way to deal with this use case. :) Note that there is a _threadedselect build /slave/ set up, but no one has yet even bothered to write the trivial reactor plugin which will make it possible for it to run any tests. For all the interest in wxPython, it continues to surprise me how little effort anyone has yet been willing to spend on making it /work/. Itamar is essentially the only person who has done any work on it, and as far as I know, he doesn't even use it. Jean-Paul
On Wednesday, February 07, 2007 10:13 AM Jean-Paul Calderone wrote:
On Wed, 07 Feb 2007 09:55:58 -0500, Itamar Shtull-Trauring <itamar@itamarst.org> wrote:
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor, unfortunately, since we don't yet have a way to make it pluggable.
Another path would be to continue to use win32er and use wxPython in a second thread without getting wxreactor involved at all.
Unfortunately, I'll probably have to do this, because I have a pretty good understanding of how to do this and how much time it would take.
A third path would be to contribute some development time to Twisted to provide a better, supported way to deal with this use case. :)
Note that there is a _threadedselect build /slave/ set up, but no one has yet even bothered to write the trivial reactor plugin which will make it possible for it to run any tests. For all the interest in wxPython, it continues to surprise me how little effort anyone has yet been willing to spend on making it /work/. Itamar is essentially the only person who has done any work on it, and as far as I know, he doesn't even use it.
If I can carve out some time, I'll try to take a look at this. WxPython and Twisted are becoming important tools for us.
Jean-Paul Calderone ha scritto:
On Wed, 07 Feb 2007 09:55:58 -0500, Itamar Shtull-Trauring <itamar@itamarst.org> wrote:
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor, unfortunately, since we don't yet have a way to make it pluggable.
Another path would be to continue to use win32er and use wxPython in a second thread without getting wxreactor involved at all.
What about just run WaitForMultipleObjects in a separate thread and dispatch the events in the main thread? Regards Manlio Perillo
Itamar Shtull-Trauring wrote:
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor,
Hey, Ive already built one of those! http://twistedmatrix.com/trac/ticket/2440
On Thursday, February 08, 2007 2:44 AM, Toby Dickenson wrote:
Itamar Shtull-Trauring wrote:
On Wed, 2007-02-07 at 07:36 -0500, Andy.Henshaw@gtri.gatech.edu wrote:
Now, I need to marry it to a wxPython GUI. Is there any reasonable way to support the twisted.internet.serialport code using wxreactor?
You'll probably have to hack up a version of _threadedselect that's based on win32eventreactor,
Hey, Ive already built one of those!
Thanks! It seems to be working, although I have a bug (probably of my own) to work out.
participants (5)
-
Andy.Henshaw@gtri.gatech.edu -
Itamar Shtull-Trauring -
Jean-Paul Calderone -
Manlio Perillo -
Toby Dickenson