From: Guenter M. <mi...@us...> - 2009-05-14 10:42:41
|
On 2009-05-13, David Goodger wrote: > 2009/5/13 Guenter Milde <mi...@us...>: >> what do I need to insert so that the writer can issue a warning for some >> non-supported feature. > You use the docutils.utils.Reporter system message mechanism. See > "Error Handling" in PEP 258 for a description of the levels. Docutils > has a mechanism for passing or filtering system messages based on > level; use it. It's not used in the writers now, only in the parser > and the transforms. A writer-dependent transform could handle this > error reporting task. I found an example in the odf writer, usage is as simple as :: self.document.reporter.warning("Error: Can't open file %s." % (source, )) without need for a writer-dependent transform or special setup :-) Thanks, Günter |