Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

»"0ÿ30oSã@sdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZddlmZmZddlmZdd	lmZdd
lmZeeƒZdd„Zd
d„Zdd„ZGdd„dƒZGdd„dƒZ Gdd„dƒZ!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)ÚTemplitecCs(tj tj t¡d¡}tj ||¡}|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_filenamesrc	Cs tt|ƒƒ
}| ¡SQRXdS)z+Return the contents of a data file of ours.N)ÚopenrÚread)rZ	data_filerrrÚ	read_data"src	CsDtjdd|tjdd}t|dƒ}| | dd¡¡WdQRXdS)	z*Write `html` to `fname`, properly encoded.z(\A\s+)|(\s+$)Ú)ÚflagsÚ
ÚwbÚasciiÚxmlcharrefreplaceN)ÚreÚsubÚ	MULTILINErÚwriteÚencode)rÚhtmlÚfoutrrrÚ
write_html(sr(c@s$eZdZdZdZdd„Zdd„ZdS)ÚHtmlDataGenerationz8Generate structured data to be turned into HTML reports.z(empty)cCsX||_|jj|_|j ¡}| ¡|_|jjrF| ¡dhkrF|j d¡| |jj¡dS)NrzNo contexts were measured)	ÚcoverageÚconfigÚget_dataÚhas_arcsÚ
show_contextsZmeasured_contextsÚ_warnZset_query_contextsZreport_contexts)ÚselfÚcovÚdatarrrÚ__init__4s


zHtmlDataGeneration.__init__csˆˆjr| ¡}| ¡}ˆjjr,|j |j¡}g}x:t| 	¡ddD]$\}}d}	g}
g}||j
krjd}	nv||jkrzd}	nfˆjrÒ||krÒd}	xR||D]6}|dkr®|
 d¡n
|
 |¡| | 
|||¡¡q–Wn||jkràd	}	d}
}d}|	rBˆjjrBt‡fd
d„| |d¡Dƒƒ}
|
ˆjgkr0ˆj}nt|
ƒ›d
}|
}| tj|||	||jk|
|||
|d	¡qDWtj| ¡|j|d}|S)z.Produce the data needed for one file's report.é)ÚstartNÚexcÚmisÚparrÚexitÚrunc3s|]}|pˆjVqdS)N)ÚEMPTY)Ú.0Úc)r0rrú	<genexpr>asz3HtmlDataGeneration.data_for_file.<locals>.<genexpr>rz 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ÚanalysisrJrKrLrIÚlinenor?rArErFÚbrBrCrDÚ	file_datar)r0rÚ
data_for_file>s\



z HtmlDataGeneration.data_for_fileN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r;r3r[rrrrr)/s
r)c@sFeZdZdZdddddgZdd„Zd	d
„Zdd„Zd
d„Zdd„Z	dS)ÚHtmlReporterzHTML reporting.z	style.csszcoverage_html.jszkeybd_closed.pngzkeybd_open.pngzfavicon_32.pngcCs4||_|jj|_|jj|_|jj|_|jdkr8|jj|_|jj|_|jdkrV|jj|_d|_d|_	|jj
}|jjr†tj
 |jj¡|_nd|_|j ¡|_|j ¡|_g|_g|_t|jƒ|_t|jƒ|_t|jjd|_ttttjtj|t t!j! "¡ƒ|j|j|jj#dddddœdœ|_$t%d	ƒ|_&t'|j&|j$ƒ|_(dS)
Nr)Ú	precisionzexc show_exczmis show_miszpar run show_parr:)r6r7r8r:)ÚescapeÚpairrRÚ__url__Ú__version__ÚtitleZ
time_stampÚ	extra_cssr-r.rAzpyfile.html))r*r+Zhtml_dirÚ	directoryZhtml_skip_coveredÚskip_coveredZhtml_skip_emptyÚ
skip_emptyÚskipped_covered_countÚskipped_empty_countZ
html_titlergrrÚbasenamer,r2r-Úfile_summariesÚall_files_numsÚIncrementalCheckerÚincrr)Údatagenr
raÚtotalsrbrcrRrdrer	ÚdatetimeÚnowr.Útemplate_globalsrÚpyfile_html_sourcerÚsource_tmpl)r0r1rfrrrr3ŠsL








zHtmlReporter.__init__cCs||j ¡|j |j|j¡x$t|j|ƒD]\}}| ||¡q*W|jsPt	dƒ‚t
|jƒ|_| ¡| 
¡|jjoz|jjS)zcGenerate an HTML report for `morfs`.

        `morfs` is a list of modules or file names.

        zNo data to report.)rqrÚcheck_global_datar+rwrr*Ú	html_filerorÚsumrsÚ
index_fileÚmake_local_static_report_filesÚn_statementsZ
pc_covered)r0ZmorfsrVrWrrrÚreportÃs
zHtmlReporter.reportc	Csx*|jD] }t t|ƒtj |j|¡¡qWtj |jd¡}tj |¡sht	|dƒ}| 
d¡WdQRX|jrŒt |jjtj |j|j¡¡dS)z5Make local instances of static files for HTML report.z
.gitignoreÚwz# Created by coverage.py
*
N)
ÚSTATIC_FILESÚshutilÚcopyfilerrrrrhÚexistsrr$rgr+)r0ZstaticZ
gitigore_pathZfgirrrr}Ýs z+HtmlReporter.make_local_static_report_filescsVt| ¡ƒ}|d}t|jƒtj |j|¡}|j}|j 	|¡|j
r||jdk}|jdk}|r||r|t
|ƒ|jd7_dS|jr¦|jdkr¦t
|ƒ|jd7_dS|j |j||¡rÐ|j 	|j |¡¡dS|j ||¡}	x.|	jD]"‰g}
xRˆjD]H\}}|dkr|
 	t|ƒ¡qút|ƒp(d}
|
 	d|›d|
›d	¡qúWd
 |
¡ˆ_ˆjrxd ‡fdd
„ˆjDƒ¡ˆ_ndˆ_ˆjr҈j}t |ƒdkr¦|dˆ_!n*d "t |ƒd dd
„t#|ddDƒ¡¡ˆ_!ndˆ_!g}ˆj$rú| 	|j%dˆj$¡d |¡pdˆ_&qèW|j' (|	j)¡}
t*||
ƒ||| ¡dœ}|j 	|¡|j +||¡dS)z*Generate an HTML file for one source file.z.htmlrr4NÚwsz&nbsp;z
<span class="z">z</span>rz,&nbsp;&nbsp; c3s|]}ˆj›d|›VqdS)z&#x202F;&#x219B;&#x202F;N)r@)r<Úd)Úldatarrr>"sz)HtmlReporter.html_file.<locals>.<genexpr>z{:d} missed branches: {}z, css"|]\}}|d›d|›VqdS)r†z) Nr)r<ÚnumZann_longrrrr>0s)r5rAú Zpln)rHÚ
html_filenamerG),rrGrrhrrrrUrorPriZ	n_missingZn_partial_branchesrrkrjr~rlrqÚ
can_skip_filer2rnÚ
index_inforrr[rIr?rbr&rEZannotaterFrRZ
annotate_longÚformatrNrArvZ	css_classrxÚrenderÚ__dict__r(Úset_index_info)r0rVrWÚrootnamerŠZ	html_pathrHZno_missing_linesZno_missing_branchesrZr&Útok_typeZtok_textZtok_htmlZlongsZcss_classesrŒr)r‡rrzîsr






zHtmlReporter.html_filecCsªttdƒ|jƒ}d}}|jr8|j}|›dt|ƒ›d}|jrX|j}|›dt|ƒ›d}| |j|j||dœ¡}t	j
 |jd¡}t
||ƒ|j d|›¡|j ¡d	S)
z*Write the index.html file for this report.z
index.htmlrz filez" skipped due to complete coverage.z empty filez	 skipped.)ÚfilesrsÚskipped_covered_msgÚskipped_empty_msgzWrote HTML report to N)rrrvrkrrlrŽrnrsrrrrhr(r*Ú_messagerqr$)r0Z
index_tmplr”r•Únr&r|rrrr|Hs"

zHtmlReporter.index_fileN)
r\r]r^r_rr3rr}rzr|rrrrr`}s9Zr`c@sheZdZdZdZdZdd„Zdd„Zdd	„Zd
d„Z	dd
„Z
dd„Zdd„Zdd„Z
dd„Zdd„ZdS)rpz0Logic and data to support incremental reporting.zstatus.jsonécCs||_| ¡dS)N)rhÚreset)r0rhrrrr3…szIncrementalChecker.__init__cCsd|_i|_dS)z5Initialize to empty. Causes all files to be reported.rN)Úglobalsr“)r0rrrr™‰szIncrementalChecker.resetc	CsÞd}y4tj |j|j¡}t|ƒ}t |¡}WdQRXWntt	fk
rTd}Yn,Xd}|d|j
krnd}n|dtjkr€d}|rÒi|_
x:|d ¡D]*\}}t|ddŽ|dd<||j
|<q˜W|d	|_n| ¡dS)
z)Read the information we stored last time.FNTrÚversionr“ÚindexrHrš)rrrrhÚSTATUS_FILErÚjsonÚloadÚOSErrorÚ
ValueErrorÚ
STATUS_FORMATr*rer“Úitemsr
ršr™)r0ÚusableÚstatus_fileZfstatusÚstatusrMÚfileinforrrrŽs&

zIncrementalChecker.readc	CsŒtj |j|j¡}i}x6|j ¡D](\}}|dd ¡|dd<|||<q"W|jt	j
|j|dœ}t|dƒ}t
j||ddWdQRXdS)zWrite the current status.rœrH)rr›ršr“r€)ú,ú:)Ú
separatorsN)rrrrhrr“r£Z	init_argsr¢r*reršrržÚdump)r0r¥r“rMr§r¦r'rrrr$§szIncrementalChecker.writecGsBtƒ}x|D]}| |¡qW| ¡}|j|kr>| ¡||_dS)z<Check the global data that can affect incremental reporting.N)rÚupdateÚ	hexdigestršr™)r0r2Úmr†Z
these_globalsrrrry¸s

z$IncrementalChecker.check_global_datacCsZtƒ}| | ¡ d¡¡t||j|ƒ| ¡}| |¡}||krFdS| ||¡dSdS)z©Can we skip reporting this file?

        `data` is a CoverageData object, `fr` is a `FileReporter`, and
        `rootname` is the name being used for the file.
        zutf-8TFN)	rr¬Úsourcer%rrMr­Ú	file_hashÚ
set_file_hash)r0r2rVr‘r®Z	this_hashZ	that_hashrrrr‹Âs
z IncrementalChecker.can_skip_filecCs|j |i¡ dd¡S)z#Get the hash of `fname`'s contents.Úhashr)r“rQ)r0rrrrr°ÖszIncrementalChecker.file_hashcCs||j |i¡d<dS)z#Set the hash of `fname`'s contents.r²N)r“Ú
setdefault)r0rÚvalrrrr±Úsz IncrementalChecker.set_file_hashcCs|j |i¡ di¡S)z/Get the information for index.html for `fname`.rœ)r“rQ)r0rrrrrŒÞszIncrementalChecker.index_infocCs||j |i¡d<dS)z/Set the information for index.html for `fname`.rœN)r“r³)r0rÚinforrrrâsz!IncrementalChecker.set_index_infoN)r\r]r^r_rr¢r3r™rr$ryr‹r°r±rŒrrrrrrpcs
rpcCs| dd¡ dd¡S)z\HTML-escape the text in `t`.

    This is only suitable for HTML text, not attributes.

    ú&z&amp;ú<z&lt;)Úreplace)ÚtrrrrbésrbcCsd|S)zEFormat a pair of numbers so JavaScript can read them in an attribute.z%s %sr)Zratiorrrrcósrc)$r_rtržrr!r‚rSr*Z
coverage.datarZcoverage.exceptionsrZcoverage.filesrZ
coverage.miscrrrrr	r
rZcoverage.reportrZcoverage.resultsr
Zcoverage.templiterrrr(r)r`rprbrcrrrrÚ<module>s4Ng