Repository URL to install this package:
Version:
1.0.8-1 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
coverage
/
__pycache__
/
html.cpython-37.pyc
|
---|
B ؏h-¿lã @ s, d Z ddlZddlZddlZddlZddlZddlZddlmZ ddlm Z m Z mZ ddlm Z ddlmZ ddlmZmZmZmZmZ ddlmZ dd lmZ dd lmZ eeZdej ej e¡d¡gZ dddZ!dd Z"dd Z#G dd de$Z%G dd de$Z&G dd 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Ú c C s g }xbt D ]Z}tj || ¡}tj |¡r,|S | |¡ |r tj ||| ¡}tj |¡rZ|S | |¡ q W td| t ¡ |f dS )a Return 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 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+$)r )ÚflagsÚ ÚwbÚasciiÚxmlcharrefreplaceN)ÚreÚsubÚ MULTILINEr ÚwriteÚencode)r ÚhtmlÚfoutr r r Ú write_htmlE 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__Q s zHtmlDataGeneration.__init__c s j r| ¡ }| ¡ } jjr,|j |j¡}g }x4t| ¡ 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}| r> jjr>t fd d|| D } | jgkr, j}nd t| ¡}| }| t||| ||jk| ||| |d ¡ qDW t| ¡ |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)r4 r r ú <genexpr>~ s z3HtmlDataGeneration.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/ r2 r6 Úcontexts_by_linenoÚfilenameÚ enumerateZsource_token_linesZexcludedÚmissingr Zmissing_arc_descriptionZ statementsÚsortedr? ÚformatÚlenr rK Únumbers)r4 ÚfrÚanalysisrN rO rP rM ÚlinenorC rE rI rJ ÚbrF rG rH Ú file_datar )r4 r Ú data_for_file[ s\ z HtmlDataGeneration.data_for_fileN)Ú__name__Ú __module__Ú__qualname__Ú__doc__r? r7 r] r r r r r- L s r- c @ sP e Zd ZdZdddddddd d dg Zdd 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.pngr c C s0 || _ | j j| _| jj| _| jj| _| jd kr8| jj| _| jj| _| jd krV| jj| _| jj}t j rn| d¡}| jjrt j | jj¡| _nd | _| j ¡ | _| j ¡ | _g | _g | _t| j| _t| j | _t | _tttt jt j|t t!j! "¡ | j| j| jj#dddddd| _$t%d| _&t'| j&| j$| _(d S ) NÚutf8zexc show_exczmis show_miszpar run show_parr>