MCPcopy Create free account
hub / github.com/datapane/datapane / PrettyPrinter

Class PrettyPrinter

python-client/src/datapane/view/visitors.py:32–46  ·  view source on GitHub ↗

Print out the view in an indented, XML-like tree form

Source from the content-addressed store, hash-verified

30
31@dc.dataclass
32class PrettyPrinter(ViewVisitor):
33 """Print out the view in an indented, XML-like tree form"""
34
35 indent: int = 1
36
37 @multimethod
38 def visit(self, b: BaseBlock):
39 print("|", "-" * self.indent, str(b), sep="")
40
41 @multimethod
42 def visit(self, b: ContainerBlock):
43 print("|", "-" * self.indent, str(b), sep="")
44 self.indent += 2
45 _ = b.traverse(self)
46 self.indent -= 2
47
48
49# TODO - split out into BlockBuilder helper here

Callers 1

pprintMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected