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

Method _check_buffer

rich/console.py:2044–2057  ·  view source on GitHub ↗

Check if the buffer may be rendered. Render it if it can (e.g. Console.quiet is False) Rendering is supported on Windows, Unix and Jupyter environments. For legacy Windows consoles, the win32 API is called directly. This method will also record what it renders if recording is

(self)

Source from the content-addressed store, hash-verified

2042 raise SystemExit(1)
2043
2044 def _check_buffer(self) -> None:
2045 """Check if the buffer may be rendered. Render it if it can (e.g. Console.quiet is False)
2046 Rendering is supported on Windows, Unix and Jupyter environments. For
2047 legacy Windows consoles, the win32 API is called directly.
2048 This method will also record what it renders if recording is enabled via Console.record.
2049 """
2050 if self.quiet:
2051 del self._buffer[:]
2052 return
2053
2054 try:
2055 self._write_buffer()
2056 except BrokenPipeError:
2057 self.on_broken_pipe()
2058
2059 def _write_buffer(self) -> None:
2060 """Write the buffer to the output file."""

Callers 2

_exit_bufferMethod · 0.95
update_screen_linesMethod · 0.95

Calls 2

_write_bufferMethod · 0.95
on_broken_pipeMethod · 0.95

Tested by

no test coverage detected