Method: rich.console.Console._render_buffer
Calls: 413, Exceptions: 0, Paths: 6Back
Path 1: 208 calls (0.5)
list (207) Segment.strip_links def (1)
'continue [y/n]: ' (6) 'Please enter Y or N\n' (6) 'foo Click\n' (4) 'Reading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13/13 bytes 0:00:00' (3) 'co...
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered
Path 2: 126 calls (0.31)
list (125) Segment.strip_styles def (1)
'\x1b[?25l' (9) 'foo\n' (8) '\n' (7) 'foo bar\n' (3) '\x1b[?25h' (3) '' (3) '\x1b[2J' (2) 'Hello\n' (2) 'foo:' (2) '\x1b[?1049h\x1b[H' (2)
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered
Path 3: 70 calls (0.17)
[] (70)
'' (70)
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered
Path 4: 6 calls (0.01)
list (6)
'\x1b[38;2;249;38;114m━━━━━\x1b[0m\x1b[38;2;249;38;114m╸\x1b[0m\x1b[38;5;237m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\x1b[0m' (1) '\x1b[38;2;249;3...
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered
Path 5: 2 calls (0.0)
list (2)
'' (2)
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered
Path 6: 1 calls (0.0)
list (1)
'\x1b[1mFOO\x1b[0m\n' (1)
1def _render_buffer(self, buffer: Iterable[Segment]) -> str:
2 """Render buffered output, and clear buffer."""
3 output: List[str] = []
4 append = output.append
5 color_system = self._color_system
6 legacy_windows = self.legacy_windows
7 not_terminal = not self.is_terminal
8 if self.no_color and color_system:
9 buffer = Segment.remove_color(buffer)
10 for text, style, control in buffer:
11 if style:
12 append(
13 style.render(
14 text,
15 color_system=color_system,
16 legacy_windows=legacy_windows,
17 )
18 )
19 elif not (not_terminal and control):
20 append(text)
21
22 rendered = "".join(output)
23 return rendered