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

1ÌÀ$ȿVã@s®ddlZddlZddlZddlZddlZddlZddlZejdkrPddlm	Z	ne
Z	dd„Zdd„Ze	j
Zdd	„ZGd
d„dejƒZGdd
„d
eƒZdd„ZGdd„dƒZdS)éN)éé)ÚOrderedDictcCst t|ƒdd¡S)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    éN)Ú	itertoolsÚisliceÚ	_ancestry)Úpath©r
úˆ/build/wlanpi-profiler-ypsphn/wlanpi-profiler-1.0.6/debian/wlanpi-profiler/opt/venvs/wlanpi-profiler/lib/python3.7/site-packages/zipp.pyÚ_parentssrccs8| tj¡}x&|r2|tjkr2|Vt |¡\}}qWdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)ÚrstripÚ	posixpathÚsepÚsplit)r	Útailr
r
rr"srcCst t|ƒj|¡S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )rÚfilterfalseÚsetÚ__contains__)ZminuendZ
subtrahendr
r
rÚ_difference<srcsHeZdZdZedd„ƒZ‡fdd„Zdd„Zdd	„Ze	d
d„ƒZ
‡ZS)ÚCompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    cCs.tj tt|ƒ¡}dd„|Dƒ}tt||ƒƒS)Ncss|]}|tjVqdS)N)rr)Ú.0Úpr
r
rú	<genexpr>Msz-CompleteDirs._implied_dirs.<locals>.<genexpr>)rÚchainÚ
from_iterableÚmaprÚ_deduper)ÚnamesÚparentsZas_dirsr
r
rÚ
_implied_dirsJszCompleteDirs._implied_dirscs tt|ƒ ¡}|t| |¡ƒS)N)ÚsuperrÚnamelistÚlistr )Úselfr)Ú	__class__r
rr"PszCompleteDirs.namelistcCst| ¡ƒS)N)rr")r$r
r
rÚ	_name_setTszCompleteDirs._name_setcCs,| ¡}|d}||ko||k}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        ú/)r&)r$ÚnamerÚdirnameZ	dir_matchr
r
rÚresolve_dirWszCompleteDirs.resolve_dircCs>t|tƒr|St|tjƒs&|t|ƒƒSd|jkr4t}||_|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        Úr)Ú
isinstancerÚzipfileÚZipFileÚ_pathlib_compatÚmoder%)ÚclsÚsourcer
r
rÚmakeas

zCompleteDirs.make)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr r"r&r*Úclassmethodr3Ú
__classcell__r
r
)r%rrDs
rcs,eZdZdZ‡fdd„Z‡fdd„Z‡ZS)Ú
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c	s.t t¡|jSQRXtt|ƒ ¡|_|jS)N)Ú
contextlibÚsuppressÚAttributeErrorZ_FastLookup__namesr!r;r")r$)r%r
rr"{szFastLookup.namelistc	s.t t¡|jSQRXtt|ƒ ¡|_|jS)N)r<r=r>Z_FastLookup__lookupr!r;r&)r$)r%r
rr&szFastLookup._name_set)r4r5r6r7r"r&r:r
r
)r%rr;usr;cCs&y| ¡Stk
r t|ƒSXdS)zi
    For path-like objects, convert to a filename for compatibility
    on Python 3.6.1 and earlier.
    N)Ú
__fspath__r>Ústr)r	r
r
rr/ˆsr/c@s®eZdZdZdZd'dd„Zd(ddœd	d
„Zedd„ƒZed
d„ƒZ	dd„Z
dd„Zdd„Zdd„Z
dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„ZeZed%d&„ƒZdS))ÚPathu4
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = zipfile.ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'mem/abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('mem/abcde.zip', 'a.txt')
    >>> b
    Path('mem/abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('mem/abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> import os
    >>> str(c).replace(os.sep, posixpath.sep)
    'mem/abcde.zip/b/c.txt'

    At the root, ``name``, ``filename``, and ``parent``
    resolve to the zipfile. Note these attributes are not
    valid and will raise a ``ValueError`` if the zipfile
    has no filename.

    >>> root.name
    'abcde.zip'
    >>> str(root.filename).replace(os.sep, posixpath.sep)
    'mem/abcde.zip'
    >>> str(root.parent)
    'mem'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})ÚcCst |¡|_||_dS)aX
        Construct a Path from a ZipFile or filename.

        Note: When the source is an existing ZipFile object,
        its type (__class__) will be mutated to a
        specialized type. If the caller wishes to retain the
        original type, the caller should either create a
        separate ZipFile object or pass a filename.
        N)r;r3ÚrootÚat)r$rCrDr
r
rÚ__init__ãs
z
Path.__init__r+N)ÚpwdcOsr| ¡rt|ƒ‚|d}| ¡s0|dkr0t|ƒ‚|jj|j||d}d|kr`|sT|r\tdƒ‚|Stj	|f|ž|ŽS)zª
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        rr+)rFÚbz*encoding args invalid for binary operation)
Úis_dirÚIsADirectoryErrorÚexistsÚFileNotFoundErrorrCÚopenrDÚ
ValueErrorÚioÚ
TextIOWrapper)r$r0rFÚargsÚkwargsZzip_modeÚstreamr
r
rrLðsz	Path.opencCst |j¡jp|jjS)N)ÚpathlibrArDr(Úfilename)r$r
r
rr(sz	Path.namecCst |jj¡ |j¡S)N)rSrArCrTÚjoinpathrD)r$r
r
rrTsz
Path.filenamec	Os$|jd|ž|Ž
}| ¡SQRXdS)Nr+)r+)rLÚread)r$rPrQÚstrmr
r
rÚ	read_text
szPath.read_textc	Cs| d¡
}| ¡SQRXdS)NÚrb)rLrV)r$rWr
r
rÚ
read_bytesszPath.read_bytescCst |j d¡¡|j d¡kS)Nr')rr)rDr
)r$r	r
r
rÚ	_is_childszPath._is_childcCs| |j|¡S)N)r%rC)r$rDr
r
rÚ_nextsz
Path._nextcCs|jp|j d¡S)Nr')rDÚendswith)r$r
r
rrHszPath.is_dircCs| ¡o| ¡S)N)rJrH)r$r
r
rÚis_fileszPath.is_filecCs|j|j ¡kS)N)rDrCr&)r$r
r
rrJszPath.existscCs.| ¡stdƒ‚t|j|j ¡ƒ}t|j|ƒS)NzCan't listdir a file)rHrMrr\rCr"Úfilterr[)r$Úsubsr
r
rÚiterdir!szPath.iterdircCst |jj|j¡S)N)rÚjoinrCrTrD)r$r
r
rÚ__str__'szPath.__str__cCs|jj|dS)N)r$)Ú_Path__reprÚformat)r$r
r
rÚ__repr__*sz
Path.__repr__cGs*tj|jftt|ƒžŽ}| |j |¡¡S)N)rrbrDrr/r\rCr*)r$ÚotherÚnextr
r
rrU-sz
Path.joinpathcCs6|js|jjSt |j d¡¡}|r,|d7}| |¡S)Nr')rDrTÚparentrr)r
r\)r$Z	parent_atr
r
rri3szPath.parent)rB)r+)r4r5r6r7rdrErLÚpropertyr(rTrXrZr[r\rHr^rJrarcrfrUÚ__truediv__rir
r
r
rrA“s&L

rA)rNrr-rr<ÚsysrSÚversion_infoÚcollectionsrÚdictrrÚfromkeysrrr.rr;r/rAr
r
r
rÚ<module>s"
1