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

Method __rich_console__

rich/text.py:689–705  ·  view source on GitHub ↗
(
        self, console: "Console", options: "ConsoleOptions"
    )

Source from the content-addressed store, hash-verified

687 self.right_crop(length - new_length)
688
689 def __rich_console__(
690 self, console: "Console", options: "ConsoleOptions"
691 ) -> Iterable[Segment]:
692 tab_size: int = console.tab_size if self.tab_size is None else self.tab_size
693 justify = self.justify or options.justify or DEFAULT_JUSTIFY
694 overflow = self.overflow or options.overflow or DEFAULT_OVERFLOW
695
696 lines = self.wrap(
697 console,
698 options.max_width,
699 justify=justify,
700 overflow=overflow,
701 tab_size=tab_size or 8,
702 no_wrap=pick_bool(self.no_wrap, options.no_wrap, False),
703 )
704 all_lines = Text("\n").join(lines)
705 yield from all_lines.render(console, end=self.end)
706
707 def __rich_measure__(
708 self, console: "Console", options: "ConsoleOptions"

Callers

nothing calls this directly

Calls 5

wrapMethod · 0.95
pick_boolFunction · 0.85
TextClass · 0.85
joinMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected