TrailingSpaceStrippingStream

Documentation for eth_defi.coloured_logging.TrailingSpaceStrippingStream Python class.

class TrailingSpaceStrippingStream

Bases: object

Stream wrapper that removes Rich’s right-padding from redirected logs.

Methods summary

__init__(wrapped)

flush()

Flush the wrapped stream.

isatty()

Return the wrapped stream's TTY status.

write(text)

Write text while trimming trailing spaces before newlines.

__init__(wrapped)
Parameters

wrapped (TextIO) –

Return type

None

write(text)

Write text while trimming trailing spaces before newlines.

Parameters

text (str) –

Return type

int

flush()

Flush the wrapped stream.

Return type

None

isatty()

Return the wrapped stream’s TTY status.

Return type

bool