Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/coverage/__pycache__/debug.cpython-35.pyc



���W��@s�dZddlZddlZddlZddlmZee�ZgZdZGdd�de�Z	dd�Z
d	d
�Zddd�Zddd
d�Z
ddd�ZdS)z'Control of and utilities for debugging.�N)�isolate_module�c@sReZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�DebugControlz!Control and output for debugging.cCs||_||_dS)z4Configure the options and output file for debugging.N)�options�output)�selfrr�r�A/opt/alt/python35/lib64/python3.5/site-packages/coverage/debug.py�__init__s	zDebugControl.__init__cCsd|j|jfS)Nz#<DebugControl options=%r output=%r>)rr)rrrr	�__repr__ szDebugControl.__repr__cCs||jkp|tkS)z@Decide whether to output debug information in category `option`.)r�FORCED_DEBUG)r�optionrrr	�should#szDebugControl.shouldcCsi|jd�r%dtj�|f}|jj|d�|jd�rXtd|j�|jj�dS)zWrite a line of debug output.�pidzpid %5d: %s�
Zcallers�outN)r�os�getpidr�write�dump_stack_frames�flush)r�msgrrr	r'szDebugControl.writecCs?|jt|��x%t|�D]}|jd|�q WdS)z.Write a sequence of (label,data) pairs nicely.z %sN)r�info_header�info_formatter)r�header�info�linerrr	�write_formatted_info0sz!DebugControl.write_formatted_infoN)	�__name__�
__module__�__qualname__�__doc__r
rrrrrrrr	rs	rcCsdjd|d�S)zMake a nice header string.z--{0:-<60s}� )�format)�labelrrr	r7srccs�t|�}|sdStdd�|D��}x�|D]�\}}|gkrTd}t|tttf�r�d||f}x?|D]"}d|d||fVd}q�Wq6d	|||fVq6WdS)
z�Produce a sequence of formatted lines from info.

    `info` is a sequence of pairs (label, data).  The produced lines are
    nicely formatted, ready to print.

    Ncss!|]\}}t|�VqdS)N)�len)�.0�l�_drrr	�	<genexpr>Fsz!info_formatter.<locals>.<genexpr>z-none-z%*s:z%*s %s�rz%*s: %s)�list�max�
isinstance�set�tuple)rZ	label_lenr$�data�prefix�errr	r<s

rcCs3tj�|dd�}djdd�|D��S)aReturn a string summarizing the call stack.

    The string is multi-line, with one line per stack frame. Each line shows
    the function name, the file name, and the line number:

        ...
        start_import_stop : /Users/ned/coverage/trunk/tests/coveragetest.py @95
        import_local_file : /Users/ned/coverage/trunk/tests/coveragetest.py @81
        import_local_file : /Users/ned/coverage/trunk/coverage/backward.py @159
        ...

    `limit` is the number of frames to include, defaulting to all of them.

    rr*rcss.|]$}d|d|d|dfVqdS)z
%30s : %s @%d�r*�Nr)r&�trrr	r)cszshort_stack.<locals>.<genexpr>���)�inspect�stack�join)�limitr8rrr	�short_stackSsr;cCs6|ptj}|jtd|��|jd�dS)z;Print a summary of the stack to stdout, or some place else.r:rN)�sys�stdoutrr;)r:rrrr	rfsrFc
CsUtdd��?}|jdjdtj�d|��|rJtd|�WdQRXdS)z.Write a log message as forcefully as possible.z/tmp/covlog.txt�az
{pid}: {msg}
rrrN)�openrr#rrr)rr8�frrr	�logms%rA)r!r7rr<Z
coverage.miscrrZ_TEST_NAME_FILE�objectrrrr;rrArrrr	�<module>s