<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    mHa                  @   s   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZejdk rPd dlm	Z	 ne
Z	dgZdd Zdd Ze	jZd	d
 ZG dd dejZG dd deZdd ZG dd dZdS )    N)      )OrderedDictPathc             C   s   t t| dd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   5/opt/alt/python37/lib/python3.7/site-packages/zipp.py_parents   s    r   c             c   s8   |  tj} x&| r2| tjkr2| V  t| \} }qW dS )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	   c             C   s   t t|j| S )zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r   filterfalseset__contains__)minuend
subtrahendr   r   r   _difference?   s    r   c                   sH   e Zd ZdZedd Z fddZdd Zdd	 Ze	d
d Z
  ZS )CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    c             C   s.   t jtt| }dd |D }tt|| S )Nc             s   s   | ]}|t j V  qd S )N)r   r   ).0pr   r   r   	<genexpr>P   s    z-CompleteDirs._implied_dirs.<locals>.<genexpr>)r   chainfrom_iterablemapr   _deduper   )namesparentsas_dirsr   r   r   _implied_dirsM   s    zCompleteDirs._implied_dirsc                s    t t|  }|t| | S )N)superr   namelistlistr$   )selfr!   )	__class__r   r   r&   S   s    zCompleteDirs.namelistc             C   s   t |  S )N)r   r&   )r(   r   r   r   	_name_setW   s    zCompleteDirs._name_setc             C   s,   |   }|d }||ko||k}|r(|S |S )zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        /)r*   )r(   namer!   dirname	dir_matchr   r   r   resolve_dirZ   s    zCompleteDirs.resolve_dirc             C   s>   t |tr|S t |tjs&| t|S d|jkr4t} | |_|S )zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r)
isinstancer   zipfileZipFile_pathlib_compatmoder)   )clssourcer   r   r   maked   s    

zCompleteDirs.make)__name__
__module____qualname____doc__staticmethodr$   r&   r*   r/   classmethodr8   __classcell__r   r   )r)   r   r   G   s   
r   c                   s,   e Zd ZdZ fddZ fddZ  ZS )
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c          	      s.   t t | jS Q R X tt|  | _| jS )N)
contextlibsuppressAttributeError_FastLookup__namesr%   r@   r&   )r(   )r)   r   r   r&   ~   s    zFastLookup.namelistc          	      s.   t t | jS Q R X tt|  | _| jS )N)rA   rB   rC   _FastLookup__lookupr%   r@   r*   )r(   )r)   r   r   r*      s    zFastLookup._name_set)r9   r:   r;   r<   r&   r*   r?   r   r   )r)   r   r@   x   s   r@   c             C   s&   y|   S  tk
r    t| S X dS )zi
    For path-like objects, convert to a filename for compatibility
    on Python 3.6.1 and earlier.
    N)
__fspath__rC   str)r
   r   r   r   r4      s    r4   c               @   s   e Zd ZdZdZd-ddZd.ddd	d
Zedd Zedd Z	edd Z
edd Zedd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* ZeZed+d, ZdS )/r   u4  
    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}) c             C   s   t || _|| _dS )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(   rI   rJ   r   r   r   __init__   s    
zPath.__init__r0   N)pwdc            O   sr   |   rt| |d }|  s0|dkr0t| | jj| j||d}d|kr`|sT|r\td|S tj	|f||S )z
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        r   r0   )rL   bz*encoding args invalid for binary operation)
is_dirIsADirectoryErrorexistsFileNotFoundErrorrI   openrJ   
ValueErrorioTextIOWrapper)r(   r5   rL   argskwargszip_modestreamr   r   r   rR      s    z	Path.openc             C   s   t | jjp| jjS )N)pathlibr   rJ   r,   filename)r(   r   r   r   r,     s    z	Path.namec             C   s   t | jjp| jjS )N)rZ   r   rJ   suffixr[   )r(   r   r   r   r\   	  s    zPath.suffixc             C   s   t | jjp| jjS )N)rZ   r   rJ   suffixesr[   )r(   r   r   r   r]     s    zPath.suffixesc             C   s   t | jjp| jjS )N)rZ   r   rJ   stemr[   )r(   r   r   r   r^     s    z	Path.stemc             C   s   t | jj| jS )N)rZ   r   rI   r[   joinpathrJ   )r(   r   r   r   r[     s    zPath.filenamec          	   O   s$   | j d||
}| S Q R X d S )Nr0   )r0   )rR   read)r(   rV   rW   strmr   r   r   	read_text  s    zPath.read_textc          	   C   s   |  d
}| S Q R X d S )Nrb)rR   r`   )r(   ra   r   r   r   
read_bytes  s    zPath.read_bytesc             C   s   t |jd| jdkS )Nr+   )r   r-   rJ   r   )r(   r
   r   r   r   	_is_child!  s    zPath._is_childc             C   s   |  | j|S )N)r)   rI   )r(   rJ   r   r   r   _next$  s    z
Path._nextc             C   s   | j  p| j dS )Nr+   )rJ   endswith)r(   r   r   r   rN   '  s    zPath.is_dirc             C   s   |   o|   S )N)rP   rN   )r(   r   r   r   is_file*  s    zPath.is_filec             C   s   | j | j kS )N)rJ   rI   r*   )r(   r   r   r   rP   -  s    zPath.existsc             C   s.   |   stdt| j| j }t| j|S )NzCan't listdir a file)rN   rS   r   rf   rI   r&   filterre   )r(   subsr   r   r   iterdir0  s    zPath.iterdirc             C   s   t | jj| jS )N)r   joinrI   r[   rJ   )r(   r   r   r   __str__6  s    zPath.__str__c             C   s   | j j| dS )N)r(   )_Path__reprformat)r(   r   r   r   __repr__9  s    zPath.__repr__c             G   s*   t j| jftt| }| | j|S )N)r   rl   rJ   r   r4   rf   rI   r/   )r(   othernextr   r   r   r_   <  s    zPath.joinpathc             C   s6   | j s| jjS t| j d}|r,|d7 }| |S )Nr+   )rJ   r[   parentr   r-   r   rf   )r(   	parent_atr   r   r   rs   B  s    zPath.parent)rH   )r0   )r9   r:   r;   r<   rn   rK   rR   propertyr,   r\   r]   r^   r[   rb   rd   re   rf   rN   rh   rP   rk   rm   rp   r_   __truediv__rs   r   r   r   r   r      s,   L
)rT   r   r2   r   rA   sysrZ   version_infocollectionsr   dict__all__r   r	   fromkeysr    r   r3   r   r@   r4   r   r   r   r   r   <module>   s$   
1