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

îÏÌWؔYÀã@sÞdZddlZddlZddlZddlmZmZddlm	Z	m
Z
mZmZddlm
Z
mZddlmZddlmZmZddlmZeeƒZe	d	d
dd„ƒZe	d
d
dd„ƒZe	dd
dd„ƒZdd„Zdd„ZGdd„deƒZdS)z'Python source expertise for coverage.pyéN)ÚenvÚfiles)ÚcontractÚ	expensiveÚisolate_moduleÚ
join_regex)ÚCoverageExceptionÚNoSource)Ú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-MIf3Xw/wlanpi-profiler-1.0.8/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}xV|D]4}||}tj |¡rVt|ƒ}Pt|ƒ}|dk	r4Pq4Wd|f}|d7}t|ƒ‚| 	dd¡}| 
t|ƒd¡}|rº|d	d
krº|d
7}|S)z#Return the source code, as unicode.z.pyz.pywNzNo source for code: '%s'.
z*Aborting report output, consider using -i.óó réÿÿÿÿÚ
)ÚosÚpathÚsplitextrÚWINDOWSÚexistsrÚ
get_zip_bytesr	rÚdecoder)rÚbaseÚextÚextsZtry_filenamerZexc_msgrrrÚ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ÚIOError)rÚmarkersÚmarkerÚpartsZziÚdatarrrr&Js	

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_filecs


r:cCsJt|dƒr|jr|j}n t|tjƒr4td |¡ƒ‚n|}tt 	|¡ƒ}|S)z6Get the source filename for the module-or-file `morf`.Ú__file__zModule {} has no file)
Úhasattrr;Ú
isinstanceÚtypesÚ
ModuleTyperÚformatr:rÚunicode_filename)ÚmorfrrrrÚsource_for_morf„srCcs¸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|ƒ}tt|ƒ t |¡¡t|dƒrr|j 	dt
j¡}t
j 
|¡ d¡r^|t
jd7}|d7}t |¡}n
t |¡}||_d|_d|_d|_dS)NÚ__name__Ú.z	__init__.Ú__init__z.py)ÚcoveragerCÚsuperrDrGrZcanonical_filenamer<rErr!r-r"ÚbasenameÚ
startswithrAÚrelative_filenameÚrelnameÚ_sourceÚ_parserZ	_excluded)ÚselfrBrHrÚname)Ú	__class__rrrG–s

zPythonFileReporter.__init__cCsd |j¡S)Nz<PythonFileReporter {!r}>)r@r)rPrrrÚ__repr__«szPythonFileReporter.__repr__r)rcCs|jS)N)rM)rPrrrrL®sz$PythonFileReporter.relative_filenamecCs2|jdkr,t|j|j d¡d|_|j ¡|jS)z&Lazily create a :class:`PythonParser`.NÚexclude)rrT)rOr
rrHZ_exclude_regexZparse_source)rPrrrÚparser²s

zPythonFileReporter.parsercCs|jjS)z2Return the line numbers of statements in the file.)rUZ
statements)rPrrrÚlines½szPythonFileReporter.linescCs|jjS)z2Return the line numbers of statements in the file.)rUZexcluded)rPrrrÚexcluded_linesÁsz!PythonFileReporter.excluded_linescCs|j |¡S)N)rUÚtranslate_lines)rPrVrrrrXÅsz"PythonFileReporter.translate_linescCs|j |¡S)N)rUÚtranslate_arcs)rPÚarcsrrrrYÈsz!PythonFileReporter.translate_arcscCs&|j t|jjjƒt|jjjƒ¡}|S)N)rUZlines_matchingrrHÚconfigZpartial_listZpartial_always_list)rPZ	no_branchrrrÚno_branch_linesËsz"PythonFileReporter.no_branch_linescCs
|j ¡S)N)rUrZ)rPrrrrZÓszPythonFileReporter.arcscCs
|j ¡S)N)rUÚexit_counts)rPrrrr]×szPythonFileReporter.exit_countscCs|j |||¡S)N)rUÚmissing_arc_description)rPÚstartÚendZ
executed_arcsrrrr^Ûsz*PythonFileReporter.missing_arc_descriptioncCs|jdkrt|jƒ|_|jS)N)rNr+r)rPrrrrÞ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#rrK)rPÚ_r)rrrÚshould_be_pythonäs	
z#PythonFileReporter.should_be_pythoncCst| ¡ƒS)N)rr)rPrrrrøsz%PythonFileReporter.source_token_lines)N)N)rEÚ
__module__Ú__qualname__Ú__doc__rGrSrrLÚpropertyrUrVrWrXrYrr\rZr]r^rrbrÚ
__classcell__rr)rRrrD“s 
rD)reÚos.pathr!r>r/rHrrZ
coverage.miscrrrrrr	Zcoverage.parserr
Zcoverage.phystokensrrZcoverage.pluginr
rr+r&r:rCrDrrrrÚ<module>s %!