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

؏‚h-¿lã@s,dZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZmZmZmZmZddlmZdd	lmZdd
lmZeeƒZdej ej e¡d¡gZ ddd„Z!dd„Z"dd„Z#Gdd„de$ƒZ%Gdd„de$ƒZ&Gdd„de$ƒZ'dd„Z(dd„Z)dS)zHTML reporting for coverage.py.éN)Úenv)ÚiitemsÚSimpleNamespaceÚformat_local_datetime)Úadd_data_to_hash)Ú
flat_rootname)ÚCoverageExceptionÚ
ensure_dirÚfile_be_goneÚHasherÚisolate_module)Úget_analysis_to_report)ÚNumbers)ÚTemplitez/usr/share/javascriptZ	htmlfilesÚcCs‚g}xbtD]Z}tj ||¡}tj |¡r,|S| |¡|r
tj |||¡}tj |¡rZ|S| |¡q
Wtd|t ¡|fƒ‚dS)aReturn the path to a data file of ours.

    The file is searched for on `STATIC_PATH`, and the first place it's found,
    is returned.

    Each directory in `STATIC_PATH` is searched as-is, and also, if `pkgdir`
    is provided, at that sub-directory.

    z/Couldn't find static file %r from %r, tried: %rN)ÚSTATIC_PATHÚosÚpathÚjoinÚexistsÚappendrÚgetcwd)ÚfnameÚpkgdirZtriedZ
static_dirZstatic_filename©rú‹/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/html.pyÚ
data_filename#s


rc	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+$)r)ÚflagsÚ
ÚwbÚasciiÚxmlcharrefreplaceN)ÚreÚsubÚ	MULTILINErÚwriteÚencode)rÚhtmlÚfoutrrrÚ
write_htmlEs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__Qs


zHtmlDataGeneration.__init__cs€ˆjr| ¡}| ¡}ˆjjr,|j |j¡}g}x4t| 	¡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}|	r>ˆjjr>t‡fd
d„||Dƒƒ}
|
ˆjgkr,ˆj}nd t|
ƒ¡}|
}| t|||	||jk|
|||
|d
	¡qDWt| ¡|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)r4rrú	<genexpr>~sz3HtmlDataGeneration.data_for_file.<locals>.<genexpr>z{} ctx)	ÚtokensÚnumberÚcategoryZ	statementÚcontextsÚcontexts_labelÚcontext_listÚshort_annotationsÚlong_annotations)Úrelative_filenameÚnumsÚlines)r1Úmissing_branch_arcsÚ
arcs_executedr/r2r6Úcontexts_by_linenoÚfilenameÚ	enumerateZsource_token_linesZexcludedÚmissingrZmissing_arc_descriptionZ
statementsÚsortedr?ÚformatÚlenrrKÚnumbers)r4ÚfrÚanalysisrNrOrPrMÚlinenorCrErIrJÚbrFrGrHÚ	file_datar)r4rÚ
data_for_file[s\



z HtmlDataGeneration.data_for_fileN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r?r7r]rrrrr-Ls
r-c
@sPeZdZdZdddddddd	d
dg
Zdd
„Zdd„Zdd„Zdd„Zdd„Z	dS)ÚHtmlReporterzHTML reporting.)z	style.cssr)z
jquery.min.jsZjquery)z"jquery.ba-throttle-debounce.min.jszjquery-throttle-debounce)zjquery.hotkeys.jszjquery-hotkeys)zjquery.isonscreen.jszjquery-isonscreen)zjquery.tablesorter.min.jszjquery-tablesorter)zcoverage_html.jsr)zkeybd_closed.pngr)zkeybd_open.pngr)zfavicon_32.pngrcCs0||_|jj|_|jj|_|jj|_|jdkr8|jj|_|jj|_|jdkrV|jj|_|jj}t	j
rn| d¡}|jjrŠt
j |jj¡|_nd|_|j ¡|_|j ¡|_g|_g|_t|jƒ|_t|jƒ|_tƒ|_ttttjtj|t t!j! "¡ƒ|j|j|jj#dddddœdœ|_$t%dƒ|_&t'|j&|j$ƒ|_(dS)	NÚutf8zexc show_exczmis show_miszpar run show_parr>)r:r;r<r>)ÚescapeÚpairrVÚ__url__Ú__version__ÚtitleZ
time_stampÚ	extra_cssr1r2rEzpyfile.html))r.r/Zhtml_dirÚ	directoryZhtml_skip_coveredÚskip_coveredZhtml_skip_emptyÚ
skip_emptyZ
html_titlerÚPY2ÚdecoderirrÚbasenamer0r6r1Úfile_summariesÚall_files_numsÚIncrementalCheckerÚincrr-ÚdatagenrÚtotalsrdrerVrfrgrÚdatetimeÚnowr2Útemplate_globalsrÚpyfile_html_sourcerÚsource_tmpl)r4r5rhrrrr7¬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.)rsrÚcheck_global_datar/ryr
r.Ú	html_filerqrÚsumruÚ
index_fileÚmake_local_static_report_filesÚn_statementsZ
pc_covered)r4ZmorfsrXrYrrrÚreportås
zHtmlReporter.reportcCsZx0|jD]&\}}t t||ƒtj |j|¡¡qW|jrVt |j	jtj |j|j¡¡dS)z5Make local instances of static files for HTML report.N)
ÚSTATIC_FILESÚshutilÚcopyfilerrrrrjrir/)r4Zstaticrrrrrÿsz+HtmlReporter.make_local_static_report_filescs2t| ¡ƒ}|d}t|jƒtj |j|¡}|j}|j 	|¡|j
rn|jdk}|jdk}|rn|rnt
|ƒdS|jrŠ|jdkrŠt
|ƒdS|j |j||¡r´|j 	|j |¡¡dS|j ||¡}	x&|	jD]‰g}
xJˆjD]@\}}|dkrþ|
 	t|ƒ¡qÞt|ƒp
d}
|
 	d ||
¡¡qÞWd |
¡ˆ_ˆjrTd ‡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 |¡pädˆ_$qÌW|j% &|	j'¡}
t(||
ƒ||| ¡dœ}|j 	|¡|j )||¡dS)z*Generate an HTML file for one source file.z.htmlrNÚwsz&nbsp;z<span class="{}">{}</span>rz,&nbsp;&nbsp; c3s|]}d ˆj|¡VqdS)z{}&#x202F;&#x219B;&#x202F;{}N)rUrD)r@Úd)ÚldatarrrBAsz)HtmlReporter.html_file.<locals>.<genexpr>r8z{:d} missed branches: {}z, css|]\}}d ||¡VqdS)z{:d}) {}N)rU)r@ÚnumZann_longrrrrBOs)r9rEú Zpln)rLÚ
html_filenamerK)*rrKr	rjrrrrWrqrrkZ	n_missingZn_partial_branchesr
rlr€rsÚ
can_skip_filer6rpÚ
index_infortr]rMrCrdrUr*rIZannotaterJrVZ
annotate_longrRrErxZ	css_classrzÚrenderÚ__dict__r,Úset_index_info)r4rXrYÚrootnamerŠZ	html_pathrLZno_missing_linesZno_missing_branchesr\r*Útok_typeZtok_textZtok_htmlZlongsZcss_classesrŒr)r‡rr|sn





zHtmlReporter.html_filecCsHttdƒ|jƒ}| |j|jdœ¡}ttj 	|j
d¡|ƒ|j ¡dS)z*Write the index.html file for this report.z
index.html)ÚfilesruN)
rrrxrrprur,rrrrjrsr()r4Z
index_tmplr*rrrr~gszHtmlReporter.index_fileN)
r^r_r`rar‚r7rrr|r~rrrrrbšs 9Xrbc@sheZdZdZdZdZdd„Zdd„Zdd	„Zd
d„Z	dd
„Z
dd„Zdd„Zdd„Z
dd„Zdd„ZdS)rrz0Logic and data to support incremental reporting.zstatus.jsonécCs||_| ¡dS)N)rjÚreset)r4rjrrrr7˜szIncrementalChecker.__init__cCsd|_i|_dS)z5Initialize to empty. Causes all files to be reported.rN)Úglobalsr’)r4rrrr”œszIncrementalChecker.resetc	CsÞd}y4tj |j|j¡}t|ƒ}t |¡}WdQRXWntt	fk
rTd}Yn,Xd}|d|j
krnd}n|dtjkr€d}|rÒi|_
x:t|dƒD]*\}}t|ddŽ|dd<||j
|<q˜W|d	|_n| ¡dS)
z)Read the information we stored last time.FNTrUÚversionr’ÚindexrLr•)rrrrjÚSTATUS_FILErÚjsonÚloadÚIOErrorÚ
ValueErrorÚ
STATUS_FORMATr.rgr’rrr•r”)r4ÚusableÚstatus_fileZfstatusÚstatusrQÚfileinforrrr¡s&

zIncrementalChecker.readc	CsŒtj |j|j¡}i}x6t|jƒD](\}}|dd ¡|dd<|||<q"W|jt	j
|j|dœ}t|dƒ}t
j||ddWdQRXdS)zWrite the current status.r—rL)rUr–r•r’Úw)ú,ú:)Ú
separatorsN)rrrrjr˜rr’Z	init_argsrr.rgr•rr™Údump)r4rŸr’rQr¡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”)r4r6Úmr†Z
these_globalsrrrr{Ë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)rrQr¨Ú	file_hashÚ
set_file_hash)r4r6rXr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’Úget)r4rrrrr«észIncrementalChecker.file_hashcCs||j |i¡d<dS)z#Set the hash of `fname`'s contents.r­N)r’Ú
setdefault)r4rÚvalrrrr¬ísz IncrementalChecker.set_file_hashcCs|j |i¡ di¡S)z/Get the information for index.html for `fname`.r—)r’r®)r4rrrrrŒñszIncrementalChecker.index_infocCs||j |i¡d<dS)z/Set the information for index.html for `fname`.r—N)r’r¯)r4rÚinforrrrõsz!IncrementalChecker.set_index_infoN)r^r_r`rar˜rr7r”rr(r{r‹r«r¬rŒrrrrrrrvs
rrcCs| dd¡ dd¡S)z\HTML-escape the text in `t`.

    This is only suitable for HTML text, not attributes.

    ú&z&amp;ú<z&lt;)Úreplace)ÚtrrrrdüsrdcCsd|S)zEFormat a pair of numbers so JavaScript can read them in an attribute.z%s %sr)Zratiorrrresre)r)*rarvr™rr%rƒr.rZcoverage.backwardrrrZ
coverage.datarZcoverage.filesrZ
coverage.miscrr	r
rrZcoverage.reportr
Zcoverage.resultsrZcoverage.templiterrrÚdirnameÚ__file__rrrr,Úobjectr-rbrrrdrerrrrÚ<module>s6
N]