[Twisted-Python] Twistd .tac + wxpython
Gabriel Rossetti
gabriel.rossetti at arimaz.com
Thu Aug 20 03:20:59 MDT 2009
Hello everyone,
I have some services written that I'd like to run in a ta.c w/ twistd.
One of them uses wxpython. I originally used the wxreactor but it seams
to have some problems on Mac OS X and Windows, so with help from some
people on this list I ended up using the wx mainloop as the mainloop and
putting the reactor in a separate thread. This seams to work well, but
now that I want to create a .tac I don't think this is possible.
The problem that prompted me to create a .tac is that if I want to use
py2app, I need just one main file and my app works using a launcher that
accepts a service name as a param and it takes care of running it. On
Windows with py2exe, I had created a main script that called the
launcher with the param in a new process. Py2exe is capable of creating
several .exe files, so I would generate the launcher and the main
script. Not being able to do this with py2app I though of ditching my
launcher and using twistd. Even in the event that I got everything to
work with the wx reactor, from what I understand twistd uses one reactor
(that can be specified via command-line), and thus I would either have
to use the wxreactor for all the services (which doesn't work), or a
standard reactor, but then it's my wx service that won't work. I thought
of maybe putting the wx mainloop in a thread and using the standard
reactor but I don't know how well this works or even if it's possible.
Does anyone have an idea? I'm open to all suggestions and proposals,
Gabriel
More information about the Twisted-Python
mailing list