Method: rich.live_render.LiveRender.__rich_console__
Calls: 117, Exceptions: 0, Paths: 6Back
Path 1: 59 calls (0.5)
Console (59)
ConsoleOptions (59)
Segment (914)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line
Path 2: 31 calls (0.26)
Console (31)
ConsoleOptions (31)
Segment (147)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line
Path 3: 10 calls (0.09)
Console (10)
ConsoleOptions (10)
Segment (255)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line
Path 4: 6 calls (0.05)
Console (6)
ConsoleOptions (6)
Segment (78)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line
Path 5: 6 calls (0.05)
Console (6)
ConsoleOptions (6)
Segment (84)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line
Path 6: 5 calls (0.04)
Console (5)
ConsoleOptions (5)
1def __rich_console__(
2 self, console: Console, options: ConsoleOptions
3 ) -> RenderResult:
4
5 renderable = self.renderable
6 style = console.get_style(self.style)
7 lines = console.render_lines(renderable, options, style=style, pad=False)
8 shape = Segment.get_shape(lines)
9
10 _, height = shape
11 if height > options.size.height:
12 if self.vertical_overflow == "crop":
13 lines = lines[: options.size.height]
14 shape = Segment.get_shape(lines)
15 elif self.vertical_overflow == "ellipsis":
16 lines = lines[: (options.size.height - 1)]
17 overflow_text = Text(
18 "...",
19 overflow="crop",
20 justify="center",
21 end="",
22 style="live.ellipsis",
23 )
24 lines.append(list(console.render(overflow_text)))
25 shape = Segment.get_shape(lines)
26 self._shape = shape
27
28 new_line = Segment.line()
29 for last, line in loop_last(lines):
30 yield from line
31 if not last:
32 yield new_line