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

ºsL¡1{!ã@s®dZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZmZmZmZeeƒZdd„Zdd	„Zed
ddd
„ƒZed
ddd„ƒZdZed
d
ddd„ƒZe
jràiZiZdd„Zndd„Ze
jred
ddd„ƒZned
d
ddd„ƒZed
ddd„ƒZdd„Zda da!eƒdd„Z"d d!„Z#Gd"d#„d#e$ƒZ%Gd$d%„d%e$ƒZ&Gd&d'„d'e$ƒZ'd(d)„Z(d1d+d,„Z)Gd-d.„d.e$ƒZ*d/d0„Z+dS)2zFile wrangling.éN)Úenv)Ú
unicode_class)ÚcontractÚCoverageExceptionÚ
join_regexÚisolate_modulecCs tj ttjƒtj¡aiadS)z?Set the directory that `relative_filename` will be relative to.N)ÚosÚpathÚnormcaseÚabs_fileÚcurdirÚsepÚRELATIVE_DIRÚCANONICAL_FILENAME_CACHE©rrúŒ/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/files.pyÚset_relative_directorysrcCstS)z=Return the directory that `relative_filename` is relative to.)rrrrrÚrelative_directory#srÚunicode)ÚreturnscCs.tj |¡}| t¡r&|ttƒd…}t|ƒS)zœReturn the relative form of `filename`.

    The file name will be relative to the current directory when the
    `set_relative_directory` was called.

    N)rr	r
Ú
startswithrÚlenÚunicode_filename)ÚfilenameZfnormrrrÚrelative_filename(s
rc	Cs”|tkrŒ|}tj |¡s|xbtjgtjD]P}|dkr6q(tj ||¡}ytj |¡}Wntk
rld}YnX|r(|}Pq(Wt	|ƒ}|t|<t|S)zzReturn a canonical file name for `filename`.

    An absolute path with no redundant components and normalized case.

    NF)
rrr	ÚisabsrÚsysÚjoinÚexistsÚUnicodeErrorr)rÚcfr	ÚfrrrrÚcanonical_filename6s"
r"éÈ)rrcCsbt |¡d}t dd|¡}t|ƒtkr^t | d¡¡ 	¡}|tt|ƒdd…d|}|S)a(A base for a flat file name to correspond to this file.

    Useful for writing files about the code where you want all the files in
    the same directory, but need to differentiate same-named files from
    different directories.

    For example, the file a/b/c.py will return 'a_b_c_py'

    éz[\\/.:]Ú_zUTF-8N)
ÚntpathÚ
splitdriveÚreÚsubrÚMAX_FLATÚhashlibÚsha1ÚencodeÚ	hexdigest)rÚnameÚhrrrÚ
flat_rootnameRs"r1cCsêtjrt|tƒr| t ¡¡}|tkr.t|Stj	 
|¡\}}|sL| ¡}n’|sV|}nˆt|ƒ}|t
krpt
|}n0yt |¡}Wntk
r–g}YnX|t
|<tj	 |¡}x"|D]}tj	 |¡|kr²|}Pq²Wtj	 ||¡}|t|<|S)z:Get the actual path of `path`, including the correct case.)rÚPY2Ú
isinstancerr-rÚgetfilesystemencodingÚ_ACTUAL_PATH_CACHErr	ÚsplitÚupperÚactual_pathÚ_ACTUAL_PATH_LIST_CACHEÚlistdirÚ	Exceptionr
r)r	ÚheadÚtailZactpathÚfilesZnormtailr!rrrr8js2



r8cCs|S)z*The actual path for non-Windows platforms.r)rrrrr8scCs*t|tƒr&t ¡pt ¡}| |d¡}|S)z'Return a Unicode version of `filename`.Úreplace)r3Ústrrr4ÚgetdefaultencodingÚdecode)rÚencodingrrrr“s
rcCs|S)z'Return a Unicode version of `filename`.r)rrrrr›scCsFytj |¡}Wntk
r$YnXtj |¡}t|ƒ}t|ƒ}|S)z.Return the absolute normalized form of `path`.)rr	ÚrealpathrÚabspathr8r)r	rrrr¡srcCstjjrtj |¡}|S)z:Return the string as Python would describe this file name.)rZ
PYBEHAVIORZreport_absolute_filesrr	rE)rrrrÚpython_reported_file®srFcCst |¡pt |¡S)z)Is `filename` an absolute path on any OS?)r&rÚ	posixpath)rrrrÚisabs_anywhereºsrHcCs>g}x4|pgD](}| d¡r(| |¡q| t|ƒ¡qW|S)a"Prepare the file patterns for use in a `FnmatchMatcher`.

    If a pattern starts with a wildcard, it is used as a pattern
    as-is.  If it does not start with a wildcard, then it is made
    absolute with the current directory.

    If `patterns` is None, an empty list is returned.

    )Ú*ú?)rÚappendr)ÚpatternsZpreppedÚprrrÚ
prep_patterns¿s

rNc@s0eZdZdZdd„Zdd„Zdd„Zdd	„Zd
S)ÚTreeMatcherzøA matcher for files in a tree.

    Construct with a list of paths, either files or directories. Paths match
    with the `match` method if they are one of the files, or if they are
    somewhere in a subtree rooted at one of the directories.

    cCst|ƒ|_dS)N)ÚlistÚpaths)ÚselfrQrrrÚ__init__ÚszTreeMatcher.__init__cCs
d|jS)Nz<TreeMatcher %r>)rQ)rRrrrÚ__repr__ÝszTreeMatcher.__repr__cCs|jS)z4A list of strings for displaying when dumping state.)rQ)rRrrrÚinfoàszTreeMatcher.infocCs@x:|jD]0}| |¡r||kr"dS|t|ƒtjkrdSqWdS)z1Does `fpath` indicate a file in one of our trees?TF)rQrrrr
)rRÚfpathrMrrrÚmatchäs
zTreeMatcher.matchN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rSrTrUrWrrrrrOÒs
rOc@s0eZdZdZdd„Zdd„Zdd„Zdd	„Zd
S)Ú
ModuleMatcherz A matcher for modules in a tree.cCst|ƒ|_dS)N)rPÚmodules)rRZmodule_namesrrrrSószModuleMatcher.__init__cCs
d|jS)Nz<ModuleMatcher %r>)r])rRrrrrTöszModuleMatcher.__repr__cCs|jS)z4A list of strings for displaying when dumping state.)r])rRrrrrUùszModuleMatcher.infocCsF|sdSx8|jD].}| |¡r||kr*dS|t|ƒdkrdSqWdS)z<Does `module_name` indicate a module in one of our packages?FTÚ.)r]rr)rRÚmodule_nameÚmrrrrWýs
zModuleMatcher.matchN)rXrYrZr[rSrTrUrWrrrrr\ñs
r\c@s0eZdZdZdd„Zdd„Zdd„Zdd	„Zd
S)ÚFnmatchMatcherz)A matcher for files by file name pattern.cCs t|ƒ|_t|jtjd|_dS)N)Úcase_insensitive)rPÚpatsÚfnmatches_to_regexrÚWINDOWSr()rRrcrrrrSs
zFnmatchMatcher.__init__cCs
d|jS)Nz<FnmatchMatcher %r>)rc)rRrrrrTszFnmatchMatcher.__repr__cCs|jS)z4A list of strings for displaying when dumping state.)rc)rRrrrrUszFnmatchMatcher.infocCs|j |¡dk	S)z1Does `fpath` match one of our file name patterns?N)r(rW)rRrVrrrrWszFnmatchMatcher.matchN)rXrYrZr[rSrTrUrWrrrrra
s
racCs&t d|¡}|r| d¡}ntj}|S)z?Find the path separator used in this string, or os.sep if none.z[\\/]r)r(ÚsearchÚgrouprr
)ÚsZ	sep_matchZthe_seprrrr
s
r
FcCsVdd„|Dƒ}dd„|Dƒ}|r.dd„|Dƒ}d}|r@|tjO}tjt|ƒ|d}|S)aºConvert fnmatch patterns to a compiled regex that matches any of them.

    Slashes are always converted to match either slash or backslash, for
    Windows support, even when running elsewhere.

    If `partial` is true, then the pattern will match if the target string
    starts with the pattern. Otherwise, it must match the entire string.

    Returns: a compiled regex object.  Use the .match method to compare target
    strings.

    css|]}t |¡VqdS)N)ÚfnmatchÚ	translate)Ú.0Úpatternrrrú	<genexpr>6sz%fnmatches_to_regex.<locals>.<genexpr>css|]}t dd|¡VqdS)z\\?/z[\\\\/]N)r(r))rkÚregexrrrrm9scss|]}t dd|¡VqdS)z\\Z(\(\?|$)z\1N)r(r))rkrnrrrrm@sr)Úflags)r(Ú
IGNORECASEÚcompiler)rLrbÚpartialZregexesroZcompiledrrrrd)s

rdc@s0eZdZdZdd„Zdd„Zdd„Zdd	„Zd
S)ÚPathAliasesa‰A collection of aliases for paths.

    When combining data files from remote machines, often the paths to source
    code are different, for example, due to OS differences, or because of
    serialized checkouts on continuous integration machines.

    A `PathAliases` object tracks a list of pattern/result pairs, and can
    map a path through those aliases to produce a unified path.

    cCs
g|_dS)N)Úaliases)rRrrrrSUszPathAliases.__init__cCs*x$|jD]\}}td |j|¡ƒqWdS)z;Dump the important parts of the PathAliases, for debugging.z
{!r} --> {!r}N)rtÚprintÚformatrl)rRrnÚresultrrrÚpprintXszPathAliases.pprintcCsšt|ƒ}t|ƒdkr| d¡}| d¡r0tdƒ‚| d¡sNt||ƒsNt|ƒ}| |¡s`||7}t|gddd}t|ƒ}| d¡|}|j	 
||f¡dS)aAdd the `pattern`/`result` pair to the list of aliases.

        `pattern` is an `fnmatch`-style pattern.  `result` is a simple
        string.  When mapping paths, if a path starts with a match against
        `pattern`, then that match is replaced with `result`.  This models
        isomorphic source trees being rooted at different places on two
        different machines.

        `pattern` can't end with a wildcard component, since that would
        match an entire tree, and not just its root.

        r$z\/rIz$Pattern must not end with wildcards.T)rbrrN)r
rÚrstripÚendswithrrrHrrdrtrK)rRrlrwZpattern_seprnZ
result_seprrrÚadd]s



zPathAliases.addcCsXxR|jD]H\}}| |¡}|r| | d¡|¡}| t|ƒt|ƒ¡}t|ƒ}|SqW|S)a?Map `path` through the aliases.

        `path` is checked against all of the patterns.  The first pattern to
        match is used to replace the root of the path with the result root.
        Only one pattern is ever used.  If no patterns match, `path` is
        returned unchanged.

        The separator style in the result is made to match that of the result
        in the alias.

        Returns the mapped path.  If a mapping has happened, this is a
        canonical path.  If no mapping has happened, it is the original value
        of `path` unchanged.

        r)rtrWr?rgr
r")rRr	rnrwr`ÚnewrrrÚmapƒs
zPathAliases.mapN)rXrYrZr[rSrxr{r}rrrrrsJs

&rsccslxftt |¡ƒD]T\}\}}}|dkr:d|kr:|dd…=qx(|D] }t d|¡r@tj ||¡Vq@WqWdS)a™Yield all of the importable Python files in `dirname`, recursively.

    To be importable, the files have to be in a directory with a __init__.py,
    except for `dirname` itself, which isn't required to have one.  The
    assumption is that `dirname` was specified directly, so the user knows
    best, but sub-directories are checked for a __init__.py to be sure we only
    find the importable files.

    rz__init__.pyNz^[^.#~!$@%^&*()+=,]+\.pyw?$)Ú	enumeraterÚwalkr(rWr	r)ÚdirnameÚiÚdirpathÚdirnamesÚ	filenamesrrrrÚfind_python_filess


r…)FF),r[r+rir&rÚos.pathrGr(rZcoveragerZcoverage.backwardrZ
coverage.miscrrrrrrrr"r*r1rer5r9r8r2rrrFrrrHrNÚobjectrOr\rar
rdrsr…rrrrÚ<module>sP
#


!S