tox does not test with unsupported python versions.
[docutils.git] / docutils / test / local-writer.py
blob04aa4b9f36a63fa8ed6be5124823410ac111ac3a
1 # $Id$
2 # Author: Engelbert Gruber <grubert@users.sourceforge.net>
3 # Copyright: This module is put into the public domain.
5 """
6 mini-writer to test get_writer_class with local writer
7 """
9 from docutils import nodes, writers
12 class Writer(writers.Writer):
14 supported = ('dummy',)
15 """Formats this writer supports."""
17 output = None
18 """Final translated form of `document`."""
20 def __init__(self):
21 writers.Writer.__init__(self)
22 self.translator_class = Translator
24 def translate(self):
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)