def __init__(self): self.document = None Writer.__init__(self)
def __init__(self, builder, single=False): Writer.__init__(self) self.single = single self.builder = builder
class Translator(nodes.NodeVisitor): def __init__(self, document): super().__init__(document) self._depth = 0 def dispatch_visit(self, node): self._depth += 1 return super().dispatch_visit(node) def dispatch_departure(self, node): r = super().dispatch_departure(node) self._depth -= 1 return r def unknown_visit(self, node): i = self._depth nodename = node.__class__.__name__ logger.debug("%svisit %s[%d] :%s", " " * i, nodename, i, node) def unknown_departure(self, node): i = self._depth nodename = node.__class__.__name__ logger.debug("%sdeparture %s[%d] :%s", " " * i, nodename, i, node) from docutils.core import publish_cmdline # NOQA logging.basicConfig(level=logging.DEBUG) publish_cmdline(writer=Writer())
def __init__(self, builder): Writer.__init__(self) self.builder = builder self.translator_class = ComponentTranslator
def __init__(self, flowdocument=True, xclass=True): self.flowdocument = flowdocument self.xclass = xclass Writer.__init__(self)
def __init__(self, visitor): self.visitor = visitor Writer.__init__(self)
def __init__(self): Writer.__init__(self) self.translator_class = DotTranslator
def __init__(self, builder): Writer.__init__(self) self.builder = builder