class documentation
class ColorizedDiffStream(BinaryIO):
Constructor: ColorizedDiffStream(output_stream)
Stream wrapper that colorizes diff output line by line using Rich.
This class wraps a binary output stream and applies color formatting to diff output as it's written. It processes data line by line to enable streaming colorization without buffering the entire diff.
| Static Method | is |
Check if Rich is available for colorization. |
| Method | __enter__ |
Context manager entry. |
| Method | __exit__ |
Context manager exit. |
| Method | __init__ |
Initialize the colorized stream wrapper. |
| Method | __iter__ |
Iterator interface - not supported. |
| Method | __next__ |
Iterator interface - not supported. |
| Method | close |
Close the stream. |
| Method | fileno |
Return the file descriptor. |
| Method | flush |
Flush any remaining buffered content and the underlying stream. |
| Method | isatty |
Check if the stream is a TTY. |
| Method | read |
Read is not supported on this write-only stream. |
| Method | readable |
This stream is not readable. |
| Method | readline |
Read is not supported on this write-only stream. |
| Method | readlines |
Read is not supported on this write-only stream. |
| Method | seek |
Seek is not supported on this stream. |
| Method | seekable |
This stream is not seekable. |
| Method | tell |
Tell is not supported on this stream. |
| Method | truncate |
Truncate is not supported on this stream. |
| Method | writable |
This stream is writable. |
| Method | write |
Write data to the stream, applying colorization. |
| Method | writelines |
Write a list of lines to the stream. |
| Instance Variable | buffer |
Undocumented |
| Instance Variable | console |
Undocumented |
| Instance Variable | output |
Undocumented |
| Instance Variable | text |
Undocumented |
| Property | closed |
Check if the stream is closed. |
| Method | _colorize |
Apply color formatting to a single line and write it. |
Check if Rich is available for colorization.
| Returns | |
bool | True if Rich can be imported, False otherwise |
def __exit__(self, exc_type:
type[ BaseException] | None, exc_val: BaseException | None, exc_tb: object | None):
¶
Context manager exit.
Initialize the colorized stream wrapper.
| Parameters | |
outputBinaryIO | The underlying binary stream to write to |