a
    ‰©lc³	  ã                   @   sn   d dl Z d dlZd dlmZmZmZ ddlmZmZm	Z	 ddgZ
dee eedœd	d„Zee	 d
œdd„ZdS )é    N)ÚContextManagerÚOptionalÚTextIOé   )Ú
DummyInputÚInputÚ	PipeInputÚcreate_inputÚcreate_pipe_inputF)ÚstdinÚalways_prefer_ttyÚreturnc                 C   s´   t jdkr<ddlm} | du r.t jdu r.tƒ S || p8t jƒS ddlm} | du r€t j} |r€t jt jt j	fD ]}| 
¡ rj|}  q€qjz|  ¡  W n tjy¦   tƒ  Y S 0 || ƒS d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   Zvt100r   ÚstdoutÚstderrÚisattyÚfilenoÚioÚUnsupportedOperation)r   r   r   r   Úobj© r   úY/var/www/html/django/DPS/env/lib/python3.9/site-packages/prompt_toolkit/input/defaults.pyr	      s$    
)r   c                  C   s6   t jdkrddlm}  |  ¡ S ddlm} | ¡ S d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)ÚPosixPipeInputN)r   r   Z
win32_piper   ÚcreateZ
posix_piper   )r   r   r   r   r   r
   ;   s
    
)NF)r   r   Útypingr   r   r   Úbaser   r   r   Ú__all__Úboolr	   r
   r   r   r   r   Ú<module>   s   þ ÿþ.