
    f	                    ^    d dl mZ d dlZd dlZd dlmZmZ ddlmZm	Z	m
Z
 ddgZd
ddZdd	Zy)    )annotationsN)ContextManagerTextIO   )
DummyInputInput	PipeInputcreate_inputcreate_pipe_inputc                   t         j                  dk(  r<ddlm} | t         j                  
t               S  || xs t         j                        S ddlm} | Zt         j                  } |rHt         j                  t         j                  t         j                  fD ]  }|j                         s|}  n 	 | j                           ||       S # t        j                  $ r t               cY S w xY w)a  
    Create the appropriate `Input` object for the current os/environment.

    :param always_prefer_tty: When set, if `sys.stdin` is connected to a Unix
        `pipe`, check whether `sys.stdout` or `sys.stderr` are connected to a
        pseudo terminal. If so, open the tty for reading instead of reading for
        `sys.stdin`. (We can open `stdout` or `stderr` for reading, this is how
        a `$PAGER` works.)
    win32r   )
Win32Input)
Vt100Input)sysplatformr   r   stdinr   vt100r   stdoutstderrisattyfilenoioUnsupportedOperation)r   always_prefer_ttyr   r   objs        X/var/www/cvtools/html/venv/lib/python3.12/site-packages/prompt_toolkit/input/defaults.pyr
   r
      s     ||w% =SYY.<%,399--% =IIE IIszz3::> Czz| #	 LLN %   && 	 <	 s   3C C+*C+c                     t         j                  dk(  rddlm}  | j	                         S ddlm} |j	                         S )aA  
    Create an input pipe.
    This is mostly useful for unit testing.

    Usage::

        with create_pipe_input() as input:
            input.send_text('inputdata')

    Breaking change: In prompt_toolkit 3.0.28 and earlier, this was returning
    the `PipeInput` directly, rather than through a context manager.
    r   r   )Win32PipeInput)PosixPipeInput)r   r   
win32_piper   create
posix_piper   )r   r   s     r   r   r   ;   s4     ||w.$$&&.$$&&    )NF)r   zTextIO | Noner   boolreturnr   )r%   zContextManager[PipeInput])
__future__r   r   r   typingr   r   baser   r   r	   __all__r
   r    r#   r   <module>r+      s1    " 	 
 ) . . )!X'r#   