Beispiel #1
0
 def render(self, console: Console, options: ConsoleOptions) -> None:
     width = self.width or options.max_width or console.width
     options = options.update_dimensions(width, None)
     style = console.get_style(self.style)
     renderable = self.renderable
     if self.padding:
         renderable = Padding(renderable, self.padding)
     self._lines[:] = console.render_lines(renderable, options, style=style)
     self.size = Size(width, len(self._lines))
     self.page.emit_no_wait(PageUpdate(self.page))
Beispiel #2
0
 def __rich_console__(self, console: Console,
                      options: ConsoleOptions) -> RenderResult:
     width = options.max_width
     height = options.height or 1
     yield from console.render(self.renderable,
                               options.update_dimensions(width, height))