)L iFddlmZddlZddlZddlmZdgZGddZy)) annotationsN)getincrementaldecoderPosixStdinReaderc4eZdZdZ d ddZdddZy) ra Wrapper around stdin which reads (nonblocking) the next available 1024 bytes and decodes it. Note that you can't be sure that the input file is closed if the ``read`` function returns an empty string. When ``errors=ignore`` is passed, ``read`` can return an empty string if all malformed input was replaced by an empty string. (We can't block here and wait for more input.) So, because of that, check the ``closed`` attribute, to be sure that the file has been closed. :param stdin_fd: File descriptor from which we read. :param errors: Can be 'ignore', 'strict' or 'replace'. On Python3, this can be 'surrogateescape', which is the default. 'surrogateescape' is preferred, because this allows us to transfer unrecognized bytes to the key bindings. Some terminals, like lxterminal and Guake, use the 'Mxx' notation to send mouse events, where each 'x' can be any possible byte. c|||_||_t||_|j||_d|_y)N)errorsF)stdin_fdrr_stdin_decoder_cls_stdin_decoderclosed)selfr rencodings f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/input/posix_utils.py__init__zPosixStdinReader.__init__&s@!  #8"A"55V5D cP|jry tj|jgggddsy t j |j|}|dk(rd|_y |j j|S#t$r d|_Y\wxYw#t$rd}Y>wxYw)z Read the input and return it as a string. Return the text. Note that this can return an empty string, even when the input stream was not yet closed. This means that something went wrong during the decoding. rTr)r selectr OSErrorosreadr decode)r countdatas rrzPosixStdinReader.read5s ;; ==$--"b!r(s)" (  U0U0r