%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core20/2318/lib/python3/dist-packages/__pycache__/
Upload File :
Create Path :
Current File : //snap/core20/2318/lib/python3/dist-packages/__pycache__/zipp.cpython-38.pyc

U

�^��@sjddlmZddlZddlZddlZddlZddlZddlZddlZe	Z
dd�Zdd�ZGdd�d�Z
dS)	�)�divisionNcCst�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	�&/usr/lib/python3/dist-packages/zipp.py�_parentssrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdS)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	r
r$src@s�eZdZdZdZd,dd�Zedd��Zedd	��Z	ed
d��Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZeZed"d#��Zed$d%��Zed&d'��Zd(d)�Zejd*kr�eZd+S)-�Pathu�
    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 = '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('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('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:

    >>> str(c)
    'abcde.zip/b/c.txt'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})�cCs,t|tj�r|nt�|�|��|_||_dS�N)�
isinstance�zipfileZZipFile�_pathlib_compat�root�at)�selfrrr	r	r
�__init__}s

��z
Path.__init__cCs,z
|��WStk
r&t|�YSXdS)zu
        For path-like objects, convert to a filename for compatibility
        on Python 3.6.1 and earlier.
        N)�
__fspath__�AttributeError�strrr	r	r
r�s
zPath._pathlib_compatcCst�|jj|j�Sr)�	functools�partialr�openr�rr	r	r
r �sz	Path.opencCst�|j�d��S�N�/)r
�basenamerrr!r	r	r
�name�sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr)r �io�
TextIOWrapper�read)r�args�kwargs�strmr	r	r
�	read_text�s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr)r r()rr+r	r	r
�
read_bytes�s
zPath.read_bytescCst�|j�d��|j�d�kSr")r
�dirnamerr)rrr	r	r
�	_is_child�szPath._is_childcCst|j|�Sr)rr)rrr	r	r
�_next�sz
Path._nextcCs|jp|j�d�Sr")r�endswithr!r	r	r
�is_dir�szPath.is_dircCs
|��Sr)r2r!r	r	r
�is_file�szPath.is_filecCs|j|��kSr)r�_namesr!r	r	r
�exists�szPath.existscCs,|��std��t|j|���}t|j|�S)NzCan't listdir a file)r2�
ValueError�mapr0r4�filterr/)rZsubsr	r	r
�iterdir�szPath.iterdircCst�|jj|j�Sr)r
�joinr�filenamerr!r	r	r
�__str__�szPath.__str__cCs|jj|d�S)Nr!)�_Path__repr�formatr!r	r	r
�__repr__�sz
Path.__repr__cCsN|�|�}t�|j|�}t�|j|d�}|��}|�||krH||krH|n|�S)Nr)rr
r:rr4r0)r�add�nextZnext_dir�namesr	r	r
�joinpath�s

z
Path.joinpathcst��fdd��D��S)Nc3s0|](}t|�D]}|d�kr|dVqqdS)r#N)r)�.0r%�parent�rBr	r
�	<genexpr>�s

�z%Path._implied_dirs.<locals>.<genexpr>)�more_itertoolsZunique_everseenrFr	rFr
�
_implied_dirs�s�zPath._implied_dirscCs|t|�|��Sr)�listrI)�clsrBr	r	r
�_add_implied_dirs�szPath._add_implied_dirscCs(t�|j�d��}|r|d7}|�|�Sr")r
r.rrr0)rZ	parent_atr	r	r
rE�szPath.parentcCs|�|j���Sr)rLrZnamelistr!r	r	r
r4�szPath._names)�N)r)�__name__�
__module__�__qualname__�__doc__r=r�staticmethodr�propertyr r%r,r-r/r0r2r3r5r9r<r?rC�__truediv__rI�classmethodrLrEr4�sys�version_infoZ__div__r	r	r	r
r:s<@








r)Z
__future__rr&rVr
rrrrH�typeZ
__metaclass__rrrr	r	r	r
�<module>s

Zerion Mini Shell 1.0