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

Method __rich_console__

rich/screen.py:40–54  ·  view source on GitHub ↗
(
        self, console: "Console", options: "ConsoleOptions"
    )

Source from the content-addressed store, hash-verified

38 self.application_mode = application_mode
39
40 def __rich_console__(
41 self, console: "Console", options: "ConsoleOptions"
42 ) -> "RenderResult":
43 width, height = options.size
44 style = console.get_style(self.style) if self.style else None
45 render_options = options.update(width=width, height=height)
46 lines = console.render_lines(
47 self.renderable or "", render_options, style=style, pad=True
48 )
49 lines = Segment.set_shape(lines, width, height, style=style)
50 new_line = Segment("\n\r") if self.application_mode else Segment.line()
51 for last, line in loop_last(lines):
52 yield from line
53 if not last:
54 yield new_line

Callers

nothing calls this directly

Calls 7

SegmentClass · 0.85
loop_lastFunction · 0.85
get_styleMethod · 0.80
render_linesMethod · 0.80
set_shapeMethod · 0.80
updateMethod · 0.45
lineMethod · 0.45

Tested by

no test coverage detected