MCPcopy
hub / github.com/Textualize/rich / _Placeholder

Class _Placeholder

rich/layout.py:51–77  ·  view source on GitHub ↗

An internal renderable used as a Layout placeholder.

Source from the content-addressed store, hash-verified

49
50
51class _Placeholder:
52 """An internal renderable used as a Layout placeholder."""
53
54 highlighter = ReprHighlighter()
55
56 def __init__(self, layout: "Layout", style: StyleType = "") -> None:
57 self.layout = layout
58 self.style = style
59
60 def __rich_console__(
61 self, console: Console, options: ConsoleOptions
62 ) -> RenderResult:
63 width = options.max_width
64 height = options.height or options.size.height
65 layout = self.layout
66 title = (
67 f"{layout.name!r} ({width} x {height})"
68 if layout.name
69 else f"({width} x {height})"
70 )
71 yield Panel(
72 Align.center(Pretty(layout), vertical="middle"),
73 style=self.style,
74 title=self.highlighter(title),
75 border_style="blue",
76 height=height,
77 )
78
79
80class Splitter(ABC):

Callers 1

__init__Method · 0.85

Calls 1

ReprHighlighterClass · 0.85

Tested by

no test coverage detected