Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/coverage/__pycache__/debug.cpython-37.pyc

B

���W��@szdZddlZddlZddlZddlmZee�ZgZdZGdd�de�Z	dd�Z
d	d
�Zddd�Zdd
d�Z
ddd�ZdS)z'Control of and utilities for debugging.�N)�isolate_module�c@s8eZdZdZdd�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/python37/lib64/python3.7/site-packages/coverage/debug.py�__init__szDebugControl.__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.shouldcCsN|�d�rdt��|f}|j�|d�|�d�r@t|jd�|j��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.writecCs2|�t|��xt|�D]}|�d|�qWdS)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	rcCsd�d|d�S)zMake a nice header string.z--{0:-<60s}� )�format)�labelrrr	r7srccs�t|�}|sdStdd�|D��}xp|D]h\}}|gkr<d}t|tttf�r�d||f}x6|D]}d|d||fVd}q^Wq(d	|||fVq(WdS)
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

rcCs&t��|dd�}d�dd�|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.

    r���rcss(|] }d|d|d|dfVqdS)z
%30s : %s @%d�r*�Nr)r&�trrr	r)cszshort_stack.<locals>.<genexpr>)�inspect�stack�join)�limitr8rrr	�short_stackSsr;cCs(|ptj}|�t|d��|�d�dS)z;Print a summary of the stack to stdout, or some place else.)r:rN)�sys�stdoutrr;)r:rrrr	rfs
rFc	Cs@tdd��,}|�djt��|d��|r2t|d�WdQRXdS)z.Write a log message as forcefully as possible.z/tmp/covlog.txt�az
{pid}: {msg}
)rr)rN)�openrr#rrr)rr8�frrr	�logmsrA)N)NN)F)r!r7rr<Z
coverage.miscrrZ_TEST_NAME_FILE�objectrrrr;rrArrrr	�<module>s