Repository URL to install this package:
|
Version:
1.0.11 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
coverage
/
__pycache__
/
html.cpython-37.pyc
|
|---|
B
»"0ÿ30oSã @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZ ddlm
Z
ddlmZmZmZmZmZ ddlmZmZ ddlmZ dd lmZ dd
lmZ eeZdd Zd
d Zdd ZG dd dZG dd dZ G dd dZ!dd Z"dd Z#dS )zHTML reporting for coverage.py.é N)Úadd_data_to_hash)ÚNoDataError)Ú
flat_rootname)Ú
ensure_dirÚfile_be_goneÚHasherÚisolate_moduleÚformat_local_datetime)Úhuman_sortedÚplural)Úget_analysis_to_report)ÚNumbers)ÚTemplitec C s( t j t j t¡d¡}t j || ¡}|S )z9Return the path to an "htmlfiles" data file of ours.
Z htmlfiles)ÚosÚpathÚjoinÚdirnameÚ__file__)ÚfnameZ
static_dirZstatic_filename© r ú/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/html.pyÚ
data_filename s r c C s t t|
}| ¡ S Q R X dS )z+Return the contents of a data file of ours.N)Úopenr Úread)r Z data_filer r r Ú read_data" s r c C sD t jdd|t jdd }t| d}| | dd¡¡ W dQ R X dS ) z*Write `html` to `fname`, properly encoded.z(\A\s+)|(\s+$)Ú )ÚflagsÚ
ÚwbÚasciiÚxmlcharrefreplaceN)ÚreÚsubÚ MULTILINEr ÚwriteÚencode)r ÚhtmlÚfoutr r r Ú
write_html( s r( c @ s$ e Zd ZdZdZdd Zdd ZdS )ÚHtmlDataGenerationz8Generate structured data to be turned into HTML reports.z(empty)c C sX || _ | j j| _| j ¡ }| ¡ | _| jjrF| ¡ dhkrF| j d¡ | | jj¡ d S )Nr zNo contexts were measured) ÚcoverageÚconfigÚget_dataÚhas_arcsÚ
show_contextsZmeasured_contextsÚ_warnZset_query_contextsZreport_contexts)ÚselfÚcovÚdatar r r Ú__init__4 s
zHtmlDataGeneration.__init__c s j r| ¡ }| ¡ } jjr,|j |j¡}g }x:t| ¡ ddD ]$\}}d} g }
g }||j
krjd} nv||jkrzd} nf j rÒ||krÒd} xR|| D ]6}|dk r®|
d¡ n
|
|¡ | |
|||¡¡ qW n||jkràd } d }
}d}| rB jjrBt fd
d| |d¡D }
|
jgkr0 j}nt|
d
}|
}| tj||| ||jk|
|||
|d ¡ qDW tj| ¡ |j|d}|S )z.Produce the data needed for one file's report.é )ÚstartNÚexcÚmisÚparr ÚexitÚrunc 3 s | ]}|p j V qd S )N)ÚEMPTY)Ú.0Úc)r0 r r ú <genexpr>a s z3HtmlDataGeneration.data_for_file.<locals>.<genexpr>r z ctx) ÚtokensÚnumberÚcategoryZ statementÚcontextsÚcontexts_labelÚcontext_listÚshort_annotationsÚlong_annotations)Úrelative_filenameÚnumsÚlines)r- Úmissing_branch_arcsÚ
arcs_executedr+ r. r2 Úcontexts_by_linenoÚfilenameÚ enumerateZsource_token_linesZexcludedÚmissingÚappendZmissing_arc_descriptionZ
statementsr
Úgetr; ÚlenÚtypesÚSimpleNamespacerG Únumbers)r0 ÚfrÚanalysisrJ rK rL rI Úlinenor? rA rE rF ÚbrB rC rD Ú file_datar )r0 r Ú
data_for_file>