[Baypiggies] wxPython, redirecting stderr etc.
Heikki Toivonen
hjtoi at comcast.net
Wed Dec 16 06:10:01 CET 2009
Tony showed one way of redirecting stderr in a wxPython application for
debugging purposes, but there is also another way: the redirect
attribute that wx.App takes.
In Chandler I used this to present the user with a feedback dialog that
showed the stack, some environment variables, and allowed the user to
enter email address and comment what they were doing, and optionally
send th report to OSAF. If you've ever used Talkback (Netscape/Mozilla
browsers) or similar, you are probably familiar with the concept.
There is more information about this in a stackoverflow entry here:
http://stackoverflow.com/questions/408810/catch-mainloop-exceptions-and-displaying-them-in-messagedialogs/517555
I should add that the server side component (a cherrypy app) is also
available in here: http://svn.osafoundation.org/ofb/ (Disclaimer: I did
not write ofb.)
By the way, even though nobody might be working on Chandler anymore, all
of the code is still available and you might find a lot of it useful in
other projects as well. See also
http://www.heikkitoivonen.net/blog/2008/08/08/chandler-hits-gold/
An example where I was able to rip a feature of Chandler and turn it
into a standalone project later on is described here:
http://www.heikkitoivonen.net/blog/2009/02/05/my-little-secret/
--
Heikki Toivonen - http://heikkitoivonen.net
More information about the Baypiggies
mailing list