B
    't\                 @   s~   d dl mZ d dlZd dlmZ d dlmZmZ d dlm	Z	m
Z
mZ ddlmZ dd	d
gZdddZe Zdd	 Zdd
 ZdS )    )unicode_literalsN)get_app)	TaskLocalTaskLocalNotSetError)
is_windowsis_conemu_ansiget_term_environment_variable   )Outputcreate_outputget_default_outputset_default_outputc             C   s~   | pt j} t r^ddlm} ddlm} ddlm}m	} | rF|| S t
 rT|| S || S nddlm} |j| t dS dS )z
    Return an :class:`~prompt_toolkit.output.Output` instance for the command
    line.

    :param stdout: The stdout object
    r	   )ConEmuOutput)Win32Output)is_win_vt100_enabledWindows10_Output)Vt100_Output)ZtermN)sys
__stdout__r   Zconemur   Zwin32r   Z	windows10r   r   r   Zvt100r   Zfrom_ptyr   )stdoutr   r   r   r   r    r   =lib/python3.7/site-packages/prompt_toolkit/output/defaults.pyr      s    

c              C   s@   yt  } W n* tk
r6   tdd}|r0|jS t S X | S dS )z
    Get the output class to be used by default.

    Called when creating a new Application(), when no `Output` has been passed.
    T)Zreturn_noneN)_default_outputgetr   r   outputr   )valueZappr   r   r   r   -   s    
c             C   s   t | tstt|  dS )z]
    Set the default `Output` class.

    (Used for instance, for the telnet submodule.)
    N)
isinstancer
   AssertionErrorr   set)r   r   r   r   r   B   s    )N)Z
__future__r   r   Z"prompt_toolkit.application.currentr   Z prompt_toolkit.eventloop.contextr   r   Zprompt_toolkit.utilsr   r   r   baser
   __all__r   r   r   r   r   r   r   r   <module>   s   
