class GenericNodeVisitor(NodeVisitor):
Known subclasses: docutils.nodes.TreeCopyVisitor
, docutils.writers._html_base.SimpleListChecker
, docutils.writers.docutils_xml.XMLTranslator
, docutils.writers.odf_odt.ODFTranslator
Generic "Visitor" abstract superclass, for simple traversals.
Unless overridden, each visit_... method calls default_visit()
, and
each depart_... method (when using Node.walkabout()
) calls
default_departure()
. default_visit()
(and default_departure()
) must
be overridden in subclasses.
Define fully generic visitors by overriding default_visit()
(and
default_departure()
) only. Define semi-generic visitors by overriding
individual visit_...() (and depart_...()) methods also.
NodeVisitor.unknown_visit()
(NodeVisitor.unknown_departure()
) should
be overridden for default behavior.
Method | default_departure |
Override for generic, uniform traversals. |
Method | default_visit |
Override for generic, uniform traversals. |
Inherited from NodeVisitor
:
Method | __init__ |
Undocumented |
Method | dispatch_departure |
Call self."depart_ + node class name" with node as parameter. If the depart_... method does not exist, call self.unknown_departure. |
Method | dispatch_visit |
Call self."visit_ + node class name" with node as parameter. If the visit_... method does not exist, call self.unknown_visit. |
Method | unknown_departure |
Called before exiting unknown Node types. |
Method | unknown_visit |
Called when entering unknown Node types. |
Class Variable | optional |
Tuple containing node class names (as strings). |
Instance Variable | document |
Undocumented |
docutils.nodes.TreeCopyVisitor
, docutils.writers.docutils_xml.XMLTranslator
, docutils.writers.odf_odt.ODFTranslator
docutils.nodes.TreeCopyVisitor
, docutils.writers._html_base.SimpleListChecker
, docutils.writers.docutils_xml.XMLTranslator
, docutils.writers.odf_odt.ODFTranslator