
    Mh	                    `    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dS )    )annotationsN)ContextManagerTextIO   )
DummyInputInput	PipeInputcreate_inputcreate_pipe_inputFstdinTextIO | Nonealways_prefer_ttyboolreturnr   c                   t           j        dk    r9ddlm} | t           j        t                      S  || pt           j                  S ddlm} | Lt           j        } |r>t           j        t           j        t           j	        fD ]}|
                                r|}  n	 |                                  n## t          j        $ r t                      cY S w xY w ||           S )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   )
Win32InputN)
Vt100Input)sysplatformr   r   r   r   vt100r   stdoutstderrisattyfilenoioUnsupportedOperation)r   r   r   r   objs        ]/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/prompt_toolkit/input/defaults.pyr
   r
      s	    |w%%%%%% =SY.<<z%,39---%%%%%% =IE  Isz3:>  Czz||  #	 LLNNNN& 	  	  	 <<	  z%   s   B4 4CCContextManager[PipeInput]c                     t           j        dk    rddlm}  |                                 S ddlm} |                                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   ;   sY     |w......$$&&&......$$&&&    )NF)r   r   r   r   r   r   )r   r    )
__future__r   r   r   typingr   r   baser   r   r	   __all__r
   r    r'   r   <module>r-      s    " " " " " " 				 



 ) ) ) ) ) ) ) ) . . . . . . . . . . )! )! )! )! )!X' ' ' ' ' 'r'   