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

ƒù£[ÂçKMã@sÎdZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZddlmZddlmZmZeeƒZGdd	„d	e	jƒZd
gZdgZdd
gZGdd„deƒZdd„Zdd„ZdS)zConfig file for coverage.pyéN)Úenv)ÚconfigparserÚiitemsÚstring_class)ÚcontractÚCoverageExceptionÚisolate_module)Úsubstitute_variables)ÚTomlConfigParserÚTomlDecodeErrorc@sZeZdZdZdd„Zddd„Zdd„Zd	d
„Zdd„Zd
d„Z	dd„Z
dd„Zdd„ZdS)ÚHandyConfigParserz#Our specialization of ConfigParser.cCs(tj |¡dg|_|r$|j d¡dS)zÞCreate the HandyConfigParser.

        `our_file` is True if this config file is specifically for coverage,
        False if we are examining another config file (tox.ini, setup.cfg)
        for possible settings.
        z	coverage:ÚN)rÚRawConfigParserÚ__init__Úsection_prefixesÚappend)ÚselfÚour_file©rú/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/config.pyrszHandyConfigParser.__init__NcCs,i}tjdkr|pd|d<tjj||f|ŽS)z-Read a file name as UTF-8 configuration data.)éézutf-8Úencoding)rZ	PYVERSIONrrÚread)rÚ	filenamesrÚkwargsrrrr&s
zHandyConfigParser.readcCs4x.|jD]$}||}tj |||¡}|r|SqWdS)NF)rrrÚ
has_option)rÚsectionÚoptionÚsection_prefixÚreal_sectionÚhasrrrr-szHandyConfigParser.has_optioncCs2x,|jD]"}||}tj ||¡}|r|SqWdS)NF)rrrÚhas_section)rrrr r!rrrr"5szHandyConfigParser.has_sectioncCsBx2|jD](}||}tj ||¡rtj ||¡SqWt |¡‚dS)N)rrrr"ÚoptionsÚNoSectionError)rrrr rrrr#=s
zHandyConfigParser.optionscCs,i}x"| |¡D]}| ||¡||<qW|S)z/Get the contents of a section, as a dictionary.)r#Úget)rrÚdÚoptrrrÚget_sectionDszHandyConfigParser.get_sectioncOs^x4|jD]}||}tj |||¡rPqWt ||¡‚tjj|||f|ž|Ž}t|tjƒ}|S)a Get a value, replacing environment variables also.

        The arguments are the same as `RawConfigParser.get`, but in the found
        value, ``$WORD`` or ``${WORD}`` are replaced by the value of the
        environment variable ``WORD``.

        Returns the finished value.

        )	rrrrÚ
NoOptionErrorr%r	ÚosÚenviron)rrrÚargsrrr Úvrrrr%Ks
zHandyConfigParser.getcCsR| ||¡}g}x<| d¡D].}x(| d¡D]}| ¡}|r,| |¡q,WqW|S)zâRead a list of strings.

        The value of `section` and `option` is treated as a comma- and newline-
        separated list of strings.  Each value is stripped of whitespace.

        Returns the list of strings.

        Ú
ú,)r%ÚsplitÚstripr)rrrÚ
value_listÚvaluesZ
value_lineÚvaluerrrÚgetlist`s	zHandyConfigParser.getlistcCs„| ||¡}g}xn| ¡D]b}| ¡}yt |¡Wn8tjk
rl}ztd||||fƒ‚Wdd}~XYnX|r| |¡qW|S)zàRead a list of full-line regexes.

        The value of `section` and `option` is treated as a newline-separated
        list of regexes.  Each value is stripped of whitespace.

        Returns the list of strings.

        zInvalid [%s].%s value %r: %sN)r%Ú
splitlinesr1ÚreÚcompileÚerrorrr)rrrZ	line_listr2r4ÚerrrÚgetregexlistrs	$zHandyConfigParser.getregexlist)N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrrr"r#r(r%r5r;rrrrrs
rz3#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)z5#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(branch|BRANCH)zwhile (True|1|False|0):zif (True|1|False|0):c+@sØeZdZdZdd„Zdddddd	d
gZdd„Zeed
dd„ƒZ	dd„Z
ddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<g+ZdKd>d?„Zd@dA„Z
dBdC„ZdDdE„ZdFdG„ZdHdI„ZdJS)LÚCoverageConfigzŠCoverage.py configuration.

    The attributes of this class are the various settings that control the
    operation of coverage.py.

    cCsRg|_g|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_g|_g|_
d|_d|_d|_g|_d|_d|_d|_d|_g|_d|_d|_tdd…|_d|_d|_d|_d|_tdd…|_ t!dd…|_"d|_#d|_$d|_%d|_&d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_.d|_/d	|_0d
|_1d|_2d|_3t4 5¡|_6i|_7dS)z:Initialize the configuration attributes to their defaults.NFz	.coveragegrZhtmlcovzCoverage reportzcoverage.xmlécz
coverage.json)8Úattempted_config_filesÚconfig_files_readÚconfig_fileÚ_config_contentsZ_includeZ_omitÚbranchÚcommand_lineÚconcurrencyÚcontextÚcover_pylibÚ	data_fileÚdebugÚdisable_warningsÚdynamic_contextÚnoteÚparallelÚpluginsÚrelative_filesÚrun_includeÚrun_omitÚsourceÚsource_pkgsÚtimidÚ_crashÚDEFAULT_EXCLUDEÚexclude_listÚ
fail_underÚ
ignore_errorsÚreport_includeÚreport_omitÚDEFAULT_PARTIAL_ALWAYSÚpartial_always_listÚDEFAULT_PARTIALÚpartial_listÚ	precisionÚreport_contextsÚshow_missingÚskip_coveredÚ
skip_emptyÚsortÚ	extra_cssÚhtml_dirÚhtml_skip_coveredÚhtml_skip_emptyÚ
html_titleÚ
show_contextsÚ
xml_outputÚxml_package_depthÚjson_outputÚjson_pretty_printÚjson_show_contextsÚcollectionsÚOrderedDictÚpathsÚplugin_options)rrrrr¦sf
zCoverageConfig.__init__rLrHrQr^r]rTrScKsHxBt|ƒD]6\}}|dk	r
||jkr4t|tƒr4|g}t|||ƒq
WdS)z!Read config values from `kwargs`.N)rÚMUST_BE_LISTÚ
isinstancerÚsetattr)rrÚkr-rrrÚ	from_argsös
zCoverageConfig.from_args)Úfilenamec
CsFtj |¡\}}|dkr"t|ƒ}nt|ƒ}|j |¡y| |¡}Wn8tj	t
fk
r|}ztd||fƒ‚Wdd}~XYnX|s†dS|j 
ttjj|ƒ¡d}y,x&|jD]}	|j|f|	žŽ}
|
rªd}qªWWn2tk
rþ}ztd||fƒ‚Wdd}~XYnXt t¡}x0|jD]&}	|	d d¡\}}
|| |
¡qWxVt|ƒD]J\}}| |¡}|rFx.t| |¡ƒ|D]}td|||fƒ‚qrWqFW| d	¡rÌx*| d	¡D]}
| d	|
¡|j|
<d}q¬Wx0|jD]&}| |¡rÔ| |¡|j|<d}qÔW|r
d}n|}|rBtj |¡|_ t!|d
ƒ}| ¡|_"WdQRX|S)a…Read configuration from a .rc file.

        `filename` is a file name to read.

        `our_file` is True if this config file is specifically for coverage,
        False if we are examining another config file (tox.ini, setup.cfg)
        for possible settings.

        Returns True or False, whether the file could be read, and it had some
        coverage.py settings in it.

        z.tomlz Couldn't read config file %s: %sNFTéú:z0Unrecognized option '[%s] %s=' in config file %srvÚrb)#r*ÚpathÚsplitextr
rrBrrrÚErrorrrrCÚextendÚmapÚabspathÚCONFIG_FILE_OPTIONSÚ_set_attr_from_config_optionÚ
ValueErrorrtÚdefaultdictÚsetr0Úaddrr"r#r5rvrQr(rwrDÚopenrE)rr}rÚ_ÚextÚcpZ
files_readÚerrZany_setÚoption_specZwas_setZall_optionsrrr#r ÚunknownÚpluginÚusedÚfrrrÚ	from_fileþs^
""



zCoverageConfig.from_filecCs
t |¡S)z#Return a copy of the configuration.)ÚcopyÚdeepcopy)rrrrr˜QszCoverageConfig.copy)rFz
run:branchÚboolean)rGzrun:command_line)rHzrun:concurrencyÚlist)rIzrun:context)rJzrun:cover_pylibrš)rKz
run:data_file)rLz	run:debugr›)rMzrun:disable_warningsr›)rNzrun:dynamic_context)rOzrun:note)rPzrun:parallelrš)rQzrun:pluginsr›)rRzrun:relative_filesrš)rSzrun:includer›)rTzrun:omitr›)rUz
run:sourcer›)rVzrun:source_pkgsr›)rWz	run:timidrš)rXz
run:_crash)rZzreport:exclude_linesÚ	regexlist)r[zreport:fail_underÚfloat)r\zreport:ignore_errorsrš)r`zreport:partial_branches_alwaysrœ)rbzreport:partial_branchesrœ)rczreport:precisionÚint)rdzreport:contextsr›)r]zreport:includer›)r^zreport:omitr›)rezreport:show_missingrš)rfzreport:skip_coveredrš)rgzreport:skip_emptyrš)rhzreport:sort)rizhtml:extra_css)rjzhtml:directory)rkzhtml:skip_coveredrš)rlzhtml:skip_emptyrš)rmz
html:title)rnzhtml:show_contextsrš)roz
xml:output)rpzxml:package_depthrž)rqzjson:output)rrzjson:pretty_printrš)rszjson:show_contextsršr
cCsB| d¡\}}| ||¡r>t|d|ƒ}t|||||ƒƒdSdS)ztSet an attribute on self if it exists in the ConfigParser.

        Returns True if the attribute was set.

        rr%TF)r0rÚgetattrrz)rrÚattrÚwhereÚtype_rrÚmethodrrrrˆ”sz+CoverageConfig._set_attr_from_config_optioncCs|j |i¡S)z:Get a dictionary of options for the plugin named `plugin`.)rwr%)rr”rrrÚget_plugin_options¡sz!CoverageConfig.get_plugin_optionsc	CsŽ|dkr||_dSx6|jD],}|dd…\}}||krt|||ƒdSqW| d¡\}}}|r~||jkr~||j |i¡|<dStd|ƒ‚dS)aBSet an option in the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with `"run:branch"`.

        `value` is the new value for the option.

        rvNrrzNo such option: %r)rvr‡rzÚ	partitionrQrwÚ
setdefaultr)	rÚoption_namer4r’r r¡Úplugin_namerŽÚkeyrrrÚ
set_option¥szCoverageConfig.set_optioncCs‚|dkr|jSx0|jD]&}|dd…\}}||krt||ƒSqW| d¡\}}}|rr||jkrr|j |i¡ |¡Std|ƒ‚dS)a<Get an option from the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with `"run:branch"`.

        Returns the value of the option.

        rvNrrzNo such option: %r)rvr‡rŸr¥rQrwr%r)rr§r’r r¡r¨rŽr©rrrÚ
get_optionÄszCoverageConfig.get_optioncCstj |¡S)z8Make final adjustments to a file path to make it usable.)r*rÚ
expanduser)rrrrrÚpost_process_fileàsz CoverageConfig.post_process_filecsNˆ ˆj¡ˆ_ˆ ˆj¡ˆ_ˆ ˆj¡ˆ_t ‡fdd„ˆj ¡Dƒ¡ˆ_dS)z7Make final adjustments to settings to make them usable.c3s(|] \}}|‡fdd„|DƒfVqdS)csg|]}ˆ |¡‘qSr)r­)Ú.0r–)rrrú
<listcomp>êsz9CoverageConfig.post_process.<locals>.<genexpr>.<listcomp>Nr)r®r{r-)rrrú	<genexpr>êsz.CoverageConfig.post_process.<locals>.<genexpr>N)r­rKrjrortrurvÚitems)rr)rrÚpost_processäs
zCoverageConfig.post_processN)r
)r<r=r>r?rrxr|rÚstrr—r˜r‡rˆr¤rªr«r­r²rrrrr@srKS

r@cCsJ|dkrd}|dk	}|s,tj d¡}|r,d}|s4d}|d|fdddg}|S)z€What config files should we try to read?

    Returns a list of tuples:
        (filename, is_our_file, was_file_specified)
    z.coveragercTZCOVERAGE_RCFILE)z	setup.cfgFF)ztox.iniFF)zpyproject.tomlFF)r*r+r%)rDÚspecified_fileÚfiles_to_tryrrrÚconfig_files_to_tryïs	r¶c
Ks¤tƒ}|rJt|ƒ}x6|D].\}}}|j||d}|r6P|rtd|ƒ‚qWtj d¡}|r`||_tj d¡}	|	rŒ|j 	dd„|	 
d¡Dƒ¡|jf|Ž| ¡|S)a¡Read the coverage.py configuration.

    Arguments:
        config_file: a boolean or string, see the `Coverage` class for the
            tricky details.
        all others: keyword arguments from the `Coverage` class, used for
            setting values in the configuration.

    Returns:
        config:
            config is a CoverageConfig object read from the appropriate
            configuration file.

    )rz#Couldn't read '%s' as a config fileZ
COVERAGE_FILEZCOVERAGE_DEBUGcss|]}| ¡VqdS)N)r1)r®r&rrrr°1sz'read_coverage_config.<locals>.<genexpr>r/)
r@r¶r—rr*r+r%rKrLr„r0r|r²)
rDrÚconfigrµÚfnamerr´Zconfig_readZ
env_data_fileZdebugsrrrÚread_coverage_configs$r¹)r?rtr˜r*Úos.pathr7ZcoveragerZcoverage.backwardrrrZ
coverage.miscrrrr	Zcoverage.tomlconfigr
rrrrYrar_Úobjectr@r¶r¹rrrrÚ<module>s*vT