From: Steve C. <ste...@ya...> - 2004-11-03 09:56:43
|
On Wed, 2004-11-03 at 12:48, mat...@li... wrote: > Message: 1 > Date: Tue, 2 Nov 2004 17:34:00 +0000 > From: Jochen Voss <vo...@se...> > To: mat...@li... > Subject: Re: [matplotlib-devel] questions about the PS backend > > > --ZPt4rx8FFjLCG7dd > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > Hello, > > On Sun, Oct 31, 2004 at 10:33:27AM -0600, John Hunter wrote: > > >> 7) The template backend uses=3D20 > > >>=20 > > >> verbose.report('Error: %s'%msg) > > >>=20 > > >> Should this be 'verbose.report_error' instead? > >=20 > > Yes. > >=20 > > Steve> No verbose() at all! But I agree I think it should be > > Steve> 'verbose.report_error' > >=20 > > Yes, it should. All printing should either go to verbose.report or > > verbose.report_error, so that the user specified output handles are > > used. This was just an oversight in backend_bases.error_msg. > > Everyone should feel free to fix these as they find them. > Then the recent change to error_msg_template should be reverted, > shouldn't it? > > All the best, > Jochen I had the problem of error_msg() being called, executing verbose.report('Error: %s'%msg) and no message being reported. I checked how backend_agg handles errors and deleted verbose.report() and updated the doc string to be consistent with the way agg uses error_msg(). We now have 'verbose' and error_msg() which both report errors. The difference is that error_msg() has the side-effect of terminating your program, which is not necessarily what you expect from its name. I'd prefer to delete error_msg() completely, use 'verbose' for all errors and add a 'raise SystemExit()' after it if you need to terminate the program. I think it would make the code easier to understand. Steve |