JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/zipp/__pycache__/__init__.cpython-39.pyc

a

��f:.�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
dgZdd�Zd	d
�ZejZdd�ZGd
d�d�ZGdd�deej�ZGdd�de�Zddd�ZGdd�d�ZdS)z�
A Path-like interface for zipfiles.

This codebase is shared between zipfile.Path in the stdlib
and zipp in PyPI. See
https://github.com/python/importlib_metadata/wiki/Development-Methodology
for more detail.
�N�)�
text_encoding)�
Translator�PathcCst�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(''))
    []
    rN)�	itertools�islice�	_ancestry)�path�r
�1/usr/lib/python3.9/site-packages/zipp/__init__.py�_parentssrccs2|�tj�}|�tj�r.|Vt�|�\}}qdS)a�
    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(''))
    []

    Multiple separators are treated like a single.

    >>> list(_ancestry('//b//d///f//'))
    ['//b//d///f', '//b//d', '//b']
    N)�rstrip�	posixpath�sep�split)r	�tailr
r
rr.srcCst�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�_differenceMsrcs4eZdZdZ�fdd�Zdd�Z�fdd�Z�ZS)�InitializedStatez?
    Mix-in to save the initialization state for pickling.
    cs"||_||_t�j|i|��dS�N)�_InitializedState__args�_InitializedState__kwargs�super�__init__)�self�args�kwargs��	__class__r
rrZszInitializedState.__init__cCs|j|jfSr)rr�rr
r
r�__getstate___szInitializedState.__getstate__cs|\}}t�j|i|��dSr)rr)r�staterrrr
r�__setstate__bszInitializedState.__setstate__)�__name__�
__module__�__qualname__�__doc__rr"r$�
__classcell__r
r
rrrUsrcsleZdZdZedd��Z�fdd�Zdd�Zdd	�Z�fd
d�Z	e
dd
��Ze
ej
ej
d�dd��Z�ZS)�CompleteDirsa8
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.

    >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt']))
    ['foo/', 'foo/bar/']
    >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/']))
    ['foo/']
    cCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr)rr)�.0�pr
r
r�	<genexpr>u�z-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterable�mapr�_deduper)�names�parentsZas_dirsr
r
r�
_implied_dirsrszCompleteDirs._implied_dirscst���}|t|�|��Sr)r�namelist�listr5)rr3rr
rr6xs
zCompleteDirs.namelistcCst|���Sr)rr6r!r
r
r�	_name_set|szCompleteDirs._name_setcCs,|��}|d}||vo||v}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        �/)r8)r�namer3�dirnameZ	dir_matchr
r
r�resolve_dirszCompleteDirs.resolve_dircsJzt��|�WStyD|�d�r2||��vr4�tj|d�YS0dS)z6
        Supplement getinfo for implied dirs.
        r9)�filenameN)r�getinfo�KeyError�endswithr8�zipfileZZipInfo)rr:rr
rr>�szCompleteDirs.getinfocCs:t|t�r|St|tj�s"||�Sd|jvr0t}||_|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        �r)�
isinstancer*rA�ZipFile�moder )�cls�sourcer
r
r�make�s

zCompleteDirs.make)�zf�returncCs$|�|���D]}|�|d�q|S)z�
        Given a writable zip file zf, inject directory entries for
        any directories implied by the presence of children.
        r.)r5r6Zwritestr)rFrIr:r
r
r�inject�szCompleteDirs.inject)r%r&r'r(�staticmethodr5r6r8r<r>�classmethodrHrArDrKr)r
r
rrr*gs



r*cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    csBt�t��|jWd�S1s&0Yt���|_|jSr)�
contextlib�suppress�AttributeErrorZ_FastLookup__namesrr6r!rr
rr6�s$zFastLookup.namelistcsBt�t��|jWd�S1s&0Yt���|_|jSr)rOrPrQZ_FastLookup__lookuprr8r!rr
rr8�s$zFastLookup._name_set)r%r&r'r(r6r8r)r
r
rrrN�srNcOs$tjjdk}d|}t||�||fS)NZpypy�)�sys�implementationr:r)�encodingrrZis_pypyZstack_levelr
r
r�_extract_text_encoding�srVc@seZdZdZdZd=dd�Zdd�Zdd	�Zd>dd�d
d�Zdd�Z	e
dd��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZeZ e
d;d<��Z!dS)?ru'
    A :class:`importlib.resources.abc.Traversable` interface for zip files.

    Implements many of the features users enjoy from
    :class:`pathlib.Path`.

    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

    >>> path = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = path.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(encoding='utf-8')
    '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.

    >>> str(path)
    'mem/abcde.zip/'
    >>> path.name
    'abcde.zip'
    >>> path.filename == pathlib.Path('mem/abcde.zip')
    True
    >>> str(path.parent)
    'mem'

    If the zipfile has no filename, such attributes are not
    valid and accessing them will raise an Exception.

    >>> zf.filename = None
    >>> path.name
    Traceback (most recent call last):
    ...
    TypeError: ...

    >>> path.filename
    Traceback (most recent call last):
    ...
    TypeError: ...

    >>> path.parent
    Traceback (most recent call last):
    ...
    TypeError: ...

    # workaround python/cpython#106763
    >>> pass
    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)rNrH�root�at)rrXrYr
r
rr5s
z
Path.__init__cCs(|j|jurtS|j|jf|j|jfkS)zU
        >>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo'
        False
        )r �NotImplementedrXrY)r�otherr
r
r�__eq__BszPath.__eq__cCst|j|jf�Sr)�hashrXrYr!r
r
r�__hash__Ksz
Path.__hash__rBN��pwdcOs�|��rt|��|d}|��s0|dkr0t|��|jj|j||d�}d|vr`|sT|r\td��|St|i|��\}}}t	j
||g|�Ri|��S)z�
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        rrBr_�bz*encoding args invalid for binary operation)�is_dir�IsADirectoryError�exists�FileNotFoundErrorrX�openrY�
ValueErrorrV�io�
TextIOWrapper)rrEr`rrZzip_mode�streamrUr
r
rrfNsz	Path.opencCst�|jp|jj�Sr)�pathlib�
PurePosixPathrYrXr=r!r
r
r�_basebsz
Path._basecCs
|��jSr)rmr:r!r
r
rr:esz	Path.namecCs
|��jSr)rm�suffixr!r
r
rrniszPath.suffixcCs
|��jSr)rm�suffixesr!r
r
rromsz
Path.suffixescCs
|��jSr)rm�stemr!r
r
rrpqsz	Path.stemcCst�|jj��|j�Sr)rkrrXr=�joinpathrYr!r
r
rr=usz
Path.filenamecOsZt|i|��\}}}|jd|g|�Ri|���}|��Wd�S1sL0YdS)NrB)rVrf�read)rrrrU�strmr
r
r�	read_textyszPath.read_textcCs6|�d��}|��Wd�S1s(0YdS)N�rb)rfrr)rrsr
r
r�
read_bytes~szPath.read_bytescCst�|j�d��|j�d�kS�Nr9)rr;rYr
)rr	r
r
r�	_is_child�szPath._is_childcCs|�|j|�Sr)r rX)rrYr
r
r�_next�sz
Path._nextcCs|jp|j�d�Srw)rYr@r!r
r
rrb�szPath.is_dircCs|��o|��Sr)rdrbr!r
r
r�is_file�szPath.is_filecCs|j|j��vSr)rYrXr8r!r
r
rrd�szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)rbrgr1ryrXr6�filterrx)rZsubsr
r
r�iterdir�szPath.iterdircCst�|j��|�Sr)rkrlrY�match)r�path_patternr
r
rr}�sz
Path.matchcCs"|j�|j�}|jd?}t�|�S)z8
        Return whether this path is a symlink.
        �)rXr>rYZ
external_attr�stat�S_ISLNK)r�inforEr
r
r�
is_symlink�s
zPath.is_symlinkcCsV|std|����t�|j�}tdd�}t�||�|��j}t|j	t
||j����S)NzUnacceptable pattern: r9)�seps)
rg�re�escaperYr�compile�	translate�	fullmatchr1ryr{rXr6)r�pattern�prefix�tr�matchesr
r
r�glob�s
z	Path.globcCs|�d|���S)Nz**/)r�)rr�r
r
r�rglob�sz
Path.rglobcGst�t|�t|j|���Sr)r�relpath�strrq)rr[Zextrar
r
r�relative_to�szPath.relative_tocCst�|jj|j�Sr)r�joinrXr=rYr!r
r
r�__str__�szPath.__str__cCs|jj|d�S)Nr!)�_Path__repr�formatr!r
r
r�__repr__�sz
Path.__repr__cGs&tj|jg|�R�}|�|j�|��Sr)rr�rYryrXr<)rr[�nextr
r
rrq�sz
Path.joinpathcCs6|js|jjSt�|j�d��}|r,|d7}|�|�Srw)rYr=�parentrr;r
ry)rZ	parent_atr
r
rr��szPath.parent)rW)rB)"r%r&r'r(r�rr\r^rfrm�propertyr:rnrorpr=rtrvrxryrbrzrdr|r}r�r�r�r�r�r�rq�__truediv__r�r
r
r
rr�sHf

	




	)N)r(rhrrArrOrkr�r�rSZcompat.py310rr�r�__all__rr�dict�fromkeysr2rrrDr*rNrVrr
r
r
r�<module>s*	K

Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8r?CIuI|֓>^ExLgNUY+{.RѪ τV׸YTD I62'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