B
    7r\u                 @   s   d dl mZmZmZ d dlZd dlZdadd Zy8ejdkrBe	n$d dl
mZmZ d dl
mZ d	d ZW n$ e	k
r   G d
d deZY nX e Ze Ze ZdZdZdZdZd ae add Zdd Zdd Zdd Zdd Zdd ZdS )    )encodingis_py3uNFc               C   s   dS )z
    Lazily init colorama if necessary, not to screw up stdout if debugging is
    not enabled.

    This version of the function does nothing.
    N r   r   r   )lib/python3.7/site-packages/jedi/debug.py_lazy_colorama_init   s    r   nt)Foreinit)
initialisec               C   s6   t s.dt_ytdd W n tk
r,   Y nX da dS )z
            Lazily init colorama if necessary, not to screw up stdout is
            debug not enabled.

            This version of the function does init colorama.
            TF)stripN)_initedr   Zatexit_doner
   	Exceptionr   r   r   r   r      s    c               @   s    e Zd ZdZdZdZdZdZdS )r	    N)__name__
__module____qualname__REDGREENYELLOWZMAGENTARESETr   r   r   r   r	   0   s
   r	   c               C   s   t   adad S )Nr   )time_start_time_debug_indentr   r   r   r   
reset_timeE   s    r   c                s    fdd}|S )zDecorator for makin c                 s"   t d7 a z
 | |S t d8 a X d S )N   )r   )argskwargs)funcr   r   wrapperM   s    
z increase_indent.<locals>.wrapperr   )r   r   r   )r   r   increase_indentK   s    r    c             O   sR   | dd}|sttrNtrNdt }t  t||d | tdd |D    dS )zB Looks at the stack, to see if a debug message should be printed. colorr    zdbg: c             s   s   | ]}t t|V  qd S )N)r   repr).0ar   r   r   	<genexpr>`   s    zdbg.<locals>.<genexpr>N)popAssertionErrordebug_functionenable_noticer   r   tuple)messager   r   r!   ir   r   r   dbgW   s    r.   c             O   sT   | dd}|rttrPtrPdt }|r>| tdd |D  } td|d |   d S )NformatTr"   c             s   s   | ]}t t|V  qd S )N)r   r#   )r$   r%   r   r   r   r&   j   s    zwarning.<locals>.<genexpr>r   z	warning: )r'   r(   r)   enable_warningr   r+   )r,   r   r   r/   r-   r   r   r   warningc   s    r1   c             C   s:   t r6tr6t }dt }t d|d d| |t f   d S )Nr"   r   zspeed: z%s %s)r)   enable_speedr   r   r   )nameZnowr-   r   r   r   speedn   s    r4   c             C   s6   t t| }t  ts |td}t|| tj  dS )z
    The default debug function that prints to standard out.

    :param str color: A string that is an attribute of ``colorama.Fore``.
    replaceN)getattrr	   r   r   encoder   printr   )r!   Zstr_outcolr   r   r   print_to_stdoutu   s
    
r:   )Zjedi._compatibilityr   r   r   osr   r   r   r3   ImportErrorZcoloramar	   r
   r   objectZNOTICEZWARNINGZSPEEDr2   r0   r*   r)   r   r   r   r    r.   r1   r4   r:   r   r   r   r   <module>   s6   	
