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

®AâJÿ]ã@sêdZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZddl
mZmZmZmZddlmZddlmZmZdd	lmZeeƒZed
ddd
„ƒZedddd„ƒZedddd„ƒZdd„Zdd„ZGdd„deƒZdS)z'Python source expertise for coverage.pyéN)Úenv)ÚCoverageExceptionÚNoSource)Úcanonical_filenameÚrelative_filename)ÚcontractÚ	expensiveÚisolate_moduleÚ
join_regex)ÚPythonParser)Úsource_token_linesÚsource_encoding)ÚFileReporterÚbytes)Úreturnsc	Cs@t|dƒ}| ¡}WdQRXtjr,t|ƒ}| dd¡ dd¡S)zFRead the Python source text from `filename`.

    Returns bytes.

    ÚrbNs
ó
ó
)ÚopenÚreadrZ
IRONPYTHONrÚreplace)ÚfilenameÚfÚsource©rúŽ/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/python.pyÚread_python_sources
rÚunicodecCs´tj |¡\}}|dkr(tjr(ddg}n|g}xL|D]4}||}tj |¡rVt|ƒ}Pt|ƒ}|dk	r4Pq4Wtd|›dƒ‚| 	dd¡}| 
t|ƒd¡}|r°|d	d
kr°|d
7}|S)z#Return the source code, as unicode.z.pyz.pywNzNo source for code: 'z'.óó réÿÿÿÿÚ
)ÚosÚpathÚsplitextrÚWINDOWSÚexistsrÚ
get_zip_bytesrrÚdecoder
)rÚbaseÚextÚextsZtry_filenamerrrrÚget_python_source&s$

r,z
bytes|Nonec	Cs¦dtjdtjdtjg}x„|D]|}||kr"| |¡}yt |d|dd…¡}Wntjk
rnw"YnXy| |d¡}Wntk
r˜w"YnX|Sq"WdS)zûGet data from `filename` if it is a zip file path.

    Returns the bytestring data read from the zip file, or None if no zip file
    could be found or `filename` isn't in it.  The data returned will be
    an empty string if the file is empty.

    z.zipz.eggz.pexrNr é)r"ÚsepÚsplitÚ	zipimportÚzipimporterÚZipImportErrorÚget_dataÚOSError)rÚmarkersÚmarkerÚpartsZziÚdatarrrr'Is	

r'cCst| d¡r|S| d¡rV|dd…}tj |¡r4|StjrR|d}tj |¡rR|S|S| d¡rp|dd…dS|S)z™Return the source filename for `filename`.

    Given a file name being traced, return the best guess as to the source
    file to attribute it to.

    z.py)z.pycz.pyoNr Úwz	$py.classi÷ÿÿÿ)Úendswithr"r#r&rr%)rZpy_filenameZpyw_filenamerrrÚsource_for_filebs


r;cCsFt|dƒr|jr|j}n"t|tjƒr6td|›dƒ‚n|}t|ƒ}|S)z6Get the source filename for the module-or-file `morf`.Ú__file__zModule z has no file)Úhasattrr<Ú
isinstanceÚtypesÚ
ModuleTyperr;)ÚmorfrrrrÚsource_for_morfƒsrBcs¸eZdZdZd#‡fdd„	Zdd„Zeddd	d
„ƒZedd„ƒZ	d
d„Z
dd„Zdd„Zdd„Z
edd„ƒZedd„ƒZedd„ƒZd$dd„Zedddd„ƒZdd „Zd!d"„Z‡ZS)%ÚPythonFileReporterz!Report support for a Python file.Ncs†||_t|ƒ}tƒ t|ƒ¡t|dƒrb|j dtj	¡}tj
 |¡ d¡rX|tj	d7}|d7}nt
|ƒ}||_d|_d|_d|_dS)NÚ__name__Ú.z	__init__.Ú__init__z.py)ÚcoveragerBÚsuperrFrr=rDrr"r.r#ÚbasenameÚ
startswithrÚrelnameÚ_sourceÚ_parserZ	_excluded)ÚselfrArGrÚname)Ú	__class__rrrF•s

zPythonFileReporter.__init__cCsd|j›dS)Nz<PythonFileReporter ú>)r)rNrrrÚ__repr__©szPythonFileReporter.__repr__r)rcCs|jS)N)rK)rNrrrr¬sz$PythonFileReporter.relative_filenamecCs2|jdkr,t|j|j d¡d|_|j ¡|jS)z&Lazily create a :class:`PythonParser`.NÚexclude)rrS)rMrrrGZ_exclude_regexZparse_source)rNrrrÚparser°s

zPythonFileReporter.parsercCs|jjS)z2Return the line numbers of statements in the file.)rTZ
statements)rNrrrÚlines»szPythonFileReporter.linescCs|jjS)z2Return the line numbers of statements in the file.)rTZexcluded)rNrrrÚexcluded_lines¿sz!PythonFileReporter.excluded_linescCs|j |¡S)N)rTÚtranslate_lines)rNrUrrrrWÃsz"PythonFileReporter.translate_linescCs|j |¡S)N)rTÚtranslate_arcs)rNÚarcsrrrrXÆsz!PythonFileReporter.translate_arcscCs&|j t|jjjƒt|jjjƒ¡}|S)N)rTZlines_matchingr
rGÚconfigZpartial_listZpartial_always_list)rNZ	no_branchrrrÚno_branch_linesÉsz"PythonFileReporter.no_branch_linescCs
|j ¡S)N)rTrY)rNrrrrYÑszPythonFileReporter.arcscCs
|j ¡S)N)rTÚexit_counts)rNrrrr\ÕszPythonFileReporter.exit_countscCs|j |||¡S)N)rTÚmissing_arc_description)rNÚstartÚendZ
executed_arcsrrrr]Ùsz*PythonFileReporter.missing_arc_descriptioncCs|jdkrt|jƒ|_|jS)N)rLr,r)rNrrrrÜs
zPythonFileReporter.sourcecCs,tj |j¡\}}| d¡r dS|s(dSdS)zäDoes it seem like this file should contain Python?

        This is used to decide if a file reported as part of the execution of
        a program was really likely to have contained Python in the first
        place.

        z.pyTF)r"r#r$rrJ)rNÚ_r*rrrÚshould_be_pythonâs	
z#PythonFileReporter.should_be_pythoncCst| ¡ƒS)N)rr)rNrrrrösz%PythonFileReporter.source_token_lines)N)N)rDÚ
__module__Ú__qualname__Ú__doc__rFrRrrÚpropertyrTrUrVrWrXrr[rYr\r]rrarÚ
__classcell__rr)rPrrC’s 
rC)rdÚos.pathr"r?r0rGrZcoverage.exceptionsrrZcoverage.filesrrZ
coverage.miscrrr	r
Zcoverage.parserrZcoverage.phystokensrr
Zcoverage.pluginrrr,r'r;rBrCrrrrÚ<module>s"#!