2 # Author: Engelbert Gruber <grubert@users.sourceforge.net>
3 # Copyright: This module is put into the public domain.
6 mini-writer to test get_writer_class with local writer
9 from docutils
import nodes
, writers
12 class Writer(writers
.Writer
):
14 supported
= ('dummy',)
15 """Formats this writer supports."""
18 """Final translated form of `document`."""
21 writers
.Writer
.__init
__(self
)
22 self
.translator_class
= Translator
25 visitor
= self
.translator_class(self
.document
)
26 self
.document
.walkabout(visitor
)
27 self
.output
= visitor
.astext()
30 class Translator(nodes
.NodeVisitor
):
31 def __init__(self
, document
):
32 nodes
.NodeVisitor
.__init
__(self
, document
)