HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/__pycache__/zipp.cpython-310.pyc
o

�N�g� �@s�ddlZddlZddlZddlZddlZddlZddlZejdkr(ddlm	Z	ne
Z	dgZdd�Zdd�Z
e	jZ	d	d
�ZGdd�dej�ZGd
d�de�Zdd�ZGdd�d�ZdS)�N)��)�OrderedDict�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(''))
    []
    �N)�	itertools�islice�	_ancestry��path�r�8/opt/saltstack/salt/lib/python3.10/site-packages/zipp.py�_parentssrccsN�|�tj�}|r!|tjkr%|Vt�|�\}}|r#|tjksdSdSdSdS)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��r	cCst�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>Ps�z-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterable�mapr�_deduper)�names�parentsZas_dirsrrr
�
_implied_dirsMszCompleteDirs._implied_dirscs tt|���}|t|�|��Sr)�superr�namelist�listr#)�selfr!��	__class__rr
r%SszCompleteDirs.namelistcCst|���Sr)rr%�r'rrr
�	_name_setWszCompleteDirs._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).
        �/)r+)r'�namer!�dirnameZ	dir_matchrrr
�resolve_dirZszCompleteDirs.resolve_dircCs>t|t�r|St|tj�s|t|��Sd|jvrt}||_|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        �r)�
isinstancer�zipfile�ZipFile�_pathlib_compat�moder))�cls�sourcerrr
�makeds

zCompleteDirs.make)�__name__�
__module__�__qualname__�__doc__�staticmethodr#r%r+r/�classmethodr8�
__classcell__rrr(r
rGs

rcs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c�Ft�t��|jWd�S1swYtt|���|_|jSr)�
contextlib�suppress�AttributeErrorZ_FastLookup__namesr$r@r%r*r(rr
r%~�
 �zFastLookup.namelistcrAr)rBrCrDZ_FastLookup__lookupr$r@r+r*r(rr
r+�rEzFastLookup._name_set)r9r:r;r<r%r+r?rrr(r
r@xsr@cCs&z|��WStyt|�YSw)zi
    For path-like objects, convert to a filename for compatibility
    on Python 3.6.1 and earlier.
    )�
__fspath__rD�strr
rrr
r4�s

�r4c@s�eZdZdZdZd-dd�Zd.dd�d	d
�Zedd��Zed
d��Z	edd��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZeZed+d,��ZdS)/ru4
    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@r8�root�at)r'rIrJrrr
�__init__�s

z
Path.__init__r0N��pwdcOsx|��rt|��|d}|��s|dkrt|��|jj|j||d�}d|vr0|s*|r.td��|Stj	|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().
        rr0rL�bz*encoding args invalid for binary operation)
�is_dir�IsADirectoryError�exists�FileNotFoundErrorrI�openrJ�
ValueError�io�
TextIOWrapper)r'r5rM�args�kwargsZzip_mode�streamrrr
rS�sz	Path.opencC�t�|j�jp
|jjSr)�pathlibrrJr-�filenamer*rrr
r-�z	Path.namecCrZr)r[rrJ�suffixr\r*rrr
r^	r]zPath.suffixcCrZr)r[rrJ�suffixesr\r*rrr
r_
r]z
Path.suffixescCrZr)r[rrJ�stemr\r*rrr
r`r]z	Path.stemcCst�|jj��|j�Sr)r[rrIr\�joinpathrJr*rrr
r\r]z
Path.filenamecOsD|jdg|�Ri|���}|��Wd�S1swYdS)Nr0�rS�read)r'rWrX�strmrrr
�	read_texts$�zPath.read_textcCs6|�d��}|��Wd�S1swYdS)N�rbrb)r'rdrrr
�
read_bytess$�zPath.read_bytescCst�|j�d��|j�d�kS�Nr,)rr.rJr)r'rrrr
�	_is_child!szPath._is_childcCs|�|j|�Sr)r)rI)r'rJrrr
�_next$�z
Path._nextcCs|jp	|j�d�Srh)rJ�endswithr*rrr
rO'szPath.is_dircCs|��o|��Sr)rQrOr*rrr
�is_file*�zPath.is_filecCs|j|j��vSr)rJrIr+r*rrr
rQ-szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)rOrTrrjrIr%�filterri)r'Zsubsrrr
�iterdir0szPath.iterdircCst�|jj|j�Sr)r�joinrIr\rJr*rrr
�__str__6rnzPath.__str__cCs|jj|d�S)Nr*)�_Path__repr�formatr*rrr
�__repr__9rkz
Path.__repr__cGs,tj|jgtt|��R�}|�|j�|��Sr)rrqrJrr4rjrIr/)r'�other�nextrrr
ra<sz
Path.joinpathcCs6|js|jjSt�|j�d��}|r|d7}|�|�Srh)rJr\�parentrr.rrj)r'Z	parent_atrrr
rxBs
zPath.parent)rH)r0)r9r:r;r<rsrKrS�propertyr-r^r_r`r\rergrirjrOrmrQrprrrura�__truediv__rxrrrr
r�s:M






)rUrr2rrB�sysr[�version_info�collectionsr�dict�__all__rr	�fromkeysr rr3rr@r4rrrrr
�<module>s(
1