From: David G. <go...@py...> - 2009-05-13 13:29:35
|
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. > > The warning should be visible in console, not in the exported document. 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. You could revert to writing to sys.stderr manually, but that would be working against the standard built-in mechanism, and I recommend against it. -- David Goodger <http://python.net/~goodger> |