flow.record.utils
¶
Module Contents¶
Classes¶
Functions¶
Return the stdout stream as binary or text stream. |
|
Return the stdin stream as binary or text stream. |
|
Returns True if |
|
Convert a value to a byte string. |
|
Convert a value to a unicode string. |
|
Convert a value to a base64 string. |
|
Catches KeyboardInterrupt and BrokenPipeError (OSError 22 on Windows). |
- flow.record.utils.get_stdout(binary: bool = False) TextIO | BinaryIO ¶
Return the stdout stream as binary or text stream.
This function is the preferred way to get the stdout stream in flow.record.
- Parameters:
binary – Whether to return the stream as binary stream.
- Returns:
The stdout stream.
- flow.record.utils.get_stdin(binary: bool = False) TextIO | BinaryIO ¶
Return the stdin stream as binary or text stream.
This function is the preferred way to get the stdin stream in flow.record.
- Parameters:
binary – Whether to return the stream as binary stream.
- Returns:
The stdin stream.
- flow.record.utils.is_stdout(fp: TextIO | BinaryIO) bool ¶
Returns True if
fp
is the stdout stream.
- flow.record.utils.to_str(value: Any) str ¶
Convert a value to a unicode string.
- flow.record.utils.to_native_str(value: str) str ¶
- flow.record.utils.to_base64(value: str) str ¶
Convert a value to a base64 string.
- flow.record.utils.catch_sigpipe(func: Callable[Ellipsis, int]) Callable[Ellipsis, int] ¶
Catches KeyboardInterrupt and BrokenPipeError (OSError 22 on Windows).