a
    lc                     @   sz   d dl Z d dlmZmZmZ d dlmZmZmZ ddl	m
Z
mZ ddlmZ ddlmZ dgZdee eed
ddZdS )    N)OptionalTextIOcast)get_bell_environment_variableget_term_environment_variableis_conemu_ansi   )DummyOutputOutput)
ColorDepth)PlainTextOutputcreate_outputF)stdoutalways_prefer_ttyreturnc                 C   s   t  }t }t }| du rPtj} |rPtjtjfD ]}|dur2| r2|}  qPq2| du r^t S ddl	m
} t| |r|| j} qjtjdkrddlm} ddlm} ddlm}	m}
 |
 rtt|	| |d	S t rtt|| |d	S || |d	S n0dd
lm} |  s
t| S |j| |||dS dS )aX  
    Return an :class:`~prompt_toolkit.output.Output` instance for the command
    line.

    :param stdout: The stdout object
    :param always_prefer_tty: When set, look for `sys.stderr` if `sys.stdout`
        is not a TTY. Useful if `sys.stdout` is redirected to a file, but we
        still want user input and output on the terminal.

        By default, this is `False`. If `sys.stdout` is not a terminal (maybe
        it's redirected to a file), then a `PlainTextOutput` will be returned.
        That way, tools like `print_formatted_text` will write plain text into
        that file.
    Nr   )StdoutProxywin32r   )ConEmuOutput)Win32Output)Windows10_Outputis_win_vt100_enabled)default_color_depth)Vt100_Output)termr   Zenable_bell)r   r   r   Zfrom_envsysr   stderrisattyr	   Zprompt_toolkit.patch_stdoutr   
isinstanceZoriginal_stdoutplatformZconemur   r   r   Z	windows10r   r   r   r
   r   Zvt100r   r   Zfrom_pty)r   r   Zterm_from_envZbell_from_envZcolor_depth_from_envior   r   r   r   r   r    r    Z/var/www/html/django/DPS/env/lib/python3.9/site-packages/prompt_toolkit/output/defaults.pyr      sL    



)NF)r   typingr   r   r   Zprompt_toolkit.utilsr   r   r   baser	   r
   Zcolor_depthr   
plain_textr   __all__boolr   r    r    r    r!   <module>   s    