Re: [pygtk] g_log_set_handler?

2004-07-06 Thread Gustavo J. A. M. Carneiro
A Seg, 2004-07-05 às 18:47, John Ehresman escreveu: Gustavo J. A. M. Carneiro wrote: Did this. All (and only) Gtk warnings now are caught and raised as python warnings. The advantage of doing so is that by default python shows the python source file and line number that caused the

Re: [pygtk] g_log_set_handler?

2004-07-05 Thread John Ehresman
Gustavo J. A. M. Carneiro wrote: Did this. All (and only) Gtk warnings now are caught and raised as python warnings. The advantage of doing so is that by default python shows the python source file and line number that caused the warning to be raised. Also, warnings can be turned into

Re: [pygtk] g_log_set_handler?

2004-07-04 Thread Gustavo J. A. M. Carneiro
A Qui, 2004-06-17 às 11:41, Gustavo J. A. M. Carneiro escreveu: A Qua, 2004-06-16 às 23:32, Tim Newsham escreveu: Hi, Is there any way to set the log handler in pygtk? I couldn't find any. I did notice a previous related thread on turning tk warnings into exceptions. I am interested

Re: [pygtk] g_log_set_handler?

2004-06-19 Thread Christian Robottom Reis
On Fri, Jun 18, 2004 at 09:44:50AM +1200, Tim Evans wrote: I think that maybe the Python 'logging' module would be a better choice than Python warnings. http://docs.python.org/lib/module-logging.html The idea I had was that the logging module was for application-level messages, not

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Gustavo J. A. M. Carneiro
A Qua, 2004-06-16 às 23:32, Tim Newsham escreveu: Hi, Is there any way to set the log handler in pygtk? I couldn't find any. I did notice a previous related thread on turning tk warnings into exceptions. I am interested in altering the default warning logging mechanism. Currently under

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Johan Dahlin
If you are interested in this, you should open a bug report in bugzilla.gnome.org, product pygtk, type enhancement. A patch will speed up the bug progress, but otherwise I will eventually do this, but it may take some time. John Ehresman already wrote one, it's included in the tarball in

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread John Ehresman
Gustavo J. A. M. Carneiro wrote: I think pygtk should install a log handler to turn all log messages into python warnings. Then, the pygtk programmer may use the standard 'warnings' module to do whatever he wishes to such warnings: hide them, turn them to exceptions, show in a text/list widget,

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Christian Robottom Reis
On Thu, Jun 17, 2004 at 11:52:57AM -0400, John Ehresman wrote: Gustavo J. A. M. Carneiro wrote: I think pygtk should install a log handler to turn all log messages into python warnings. Then, the pygtk programmer may use the standard 'warnings' module to do whatever he wishes to such

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Johan Dahlin
Speaking of this patch, we should start discussion on whether we want it in for 2.4 or not. Johan (and someone else?) has expressed reservations because he feels that most of it duplicates functionality already in the Python standard library. I'm sure you have a good argument against that one

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread John Ehresman
Christian Robottom Reis wrote: Speaking of this patch, we should start discussion on whether we want it in for 2.4 or not. Johan (and someone else?) has expressed reservations because he feels that most of it duplicates functionality already in the Python standard library. I'm sure you have a good

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Gustavo J. A. M. Carneiro
A Qui, 2004-06-17 às 16:52, John Ehresman escreveu: Gustavo J. A. M. Carneiro wrote: I think pygtk should install a log handler to turn all log messages into python warnings. Then, the pygtk programmer may use the standard 'warnings' module to do whatever he wishes to such warnings: hide

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Tim Newsham
I think pygtk should install a log handler to turn all log messages into python warnings. Then, the pygtk programmer may use the standard 'warnings' module to do whatever he wishes to such warnings: hide them, turn them to exceptions, show in a text/list widget, etc. I'm not sure why a new

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Christian Robottom Reis
On Thu, Jun 17, 2004 at 03:41:52PM -0400, John Ehresman wrote: Tim Newsham wrote: I'm not sure why a new mechanism is needed. GLIB already provides a mechanism for intercepting the log messages (g_log_set_handler). If this was exposed in pygtk, then a programmer could intercept the log

Re: [pygtk] g_log_set_handler?

2004-06-17 Thread Tim Evans
Gustavo J. A. M. Carneiro wrote: A Qua, 2004-06-16 às 23:32, Tim Newsham escreveu: Hi, Is there any way to set the log handler in pygtk? I couldn't find any. I did notice a previous related thread on turning tk warnings into exceptions. I am interested in altering the default warning logging