Your IP : 216.73.216.213
B
E�W�9 � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ee�ZyddlmZmZ W n< ek
r� e�d �d
kr�ej�d� e�d� dZY nX G d
d� de�Zdd� ZG dd� de�ZdS )z#Raw data collector for coverage.py.� N)�env)�iitems)�abs_file)�CoverageException�isolate_module)�PyTracer)�CTracer�CFileDispositionZCOVERAGE_TEST_TRACER�cz:*** COVERAGE_TEST_TRACER is 'c' but can't import CTracer!
� c @ s e Zd ZdZdS )�FileDispositionz9A simple value type for recording what to do with a file.N)�__name__�
__module__�__qualname__�__doc__� r r �E/opt/alt/python37/lib64/python3.7/site-packages/coverage/collector.pyr # s r c C s | j j}|�d�r|S dS )zKWho-Tests-What hack: Determine whether this frame begins a new who-context.�testN)�f_code�co_name�
startswith)�frameZfn_namer r r �should_start_context( s
r c @ s� e Zd ZdZg Zeddddg�Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� ZdS )� Collectora Collects trace data.
Creates a Tracer object for each thread, since they track stack
information. Each Tracer points to the same shared data, contributing
traced data points.
When the Collector is started, it creates a Tracer for the current thread,
and installs a function to create Tracers for each new thread started.
When the Collector is stopped, all active Tracers are stopped.
Threads started while the Collector is stopped will never have Tracers
associated with them.
�greenlet�eventlet�gevent�threadc C sf || _ || _|| _|| _d| _d| _| j�|�}t|�dkrHt d| ��|rT|�
� nd| _y�| jdkrxddl}|j
| _nf| jdkr�ddl} | jj
| _nH| jdkr�ddl}
|
j
| _n,| jd ks�| js�ddl}|| _nt d
| ��W n& tk
�r t d| jf ��Y nX tt�dd��| _| �� |�r0t| _nt�p8t| _| jtk�rVt| _d
| _nt| _d| _dS )a� Create a collector.
`should_trace` is a function, taking a file name, and returning a
`coverage.FileDisposition object`.
`check_include` is a function taking a file name and a frame. It returns
a boolean: True if the file should be traced, False if not.
If `timid` is true, then a slower simpler trace function will be
used. This is important for some environments where manipulation of
tracing functions make the faster more sophisticated trace function not
operate properly.
If `branch` is true, then branches will be measured. This involves
collecting data on which statements followed each other (arcs). Use
`get_arc_data` to get the arc data.
`warn` is a warning function, taking a single string message argument,
to be used if a warning needs to be issued.
`concurrency` is a list of strings indicating the concurrency libraries
in use. Valid values are "greenlet", "eventlet", "gevent", or "thread"
(the default). Of these four values, only one can be supplied. Other
values are ignored.
Nr z$Conflicting concurrency settings: %s� r r r r r zDon't understand concurrency=%sz?Couldn't trace with concurrency=%s, the module isn't installed.ZCOVERAGE_WTWTF)�should_trace�
check_include�warn�branch� threading�concur_id_func�SUPPORTED_CONCURRENCIES�intersection�lenr �pop�concurrencyr Z
getcurrentZeventlet.greenthreadZgreenthreadr �ImportError�int�os�getenv�wtw�resetr �_trace_classr r Zfile_disposition_classZsupports_pluginsr )�selfr r Ztimidr"