Ë
    
_ßdé   ã                   óø   — 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  rd dlm	Z	 ne
Z	dgZd„ Zd„ Ze	j                  Z	 d„ Z G d„ d	ej"                  «      Z G d
„ de«      Zd„ Z G d„ d«      Zy)é    N)é   é   )ÚOrderedDictÚPathc                 óB   — t        j                  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©Úpaths    ú9/usr/lib/python3/dist-packages/setuptools/_vendor/zipp.pyÚ_parentsr      s   € ô  ×ÑœI d›O¨Q°Ó5Ð5ó    c              #   óÞ   K  — | j                  t        j                  «      } | rH| t        j                  k7  r4| –— t        j                  | «      \  } }| r| t        j                  k7  rŒ2yyyy­w)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   Útails     r   r   r   %   sV   è ø€ ð  �;‰;”y—}‘}Ó%€DÙ
�4œ9Ÿ=™=Ò(ØŠ
Ü—_‘_ TÓ*‰
ˆˆdñ �4œ9Ÿ=™=Ô(ˆ$Ð(ˆ$ùs   ‚A&A-Á)A-c                 óT   — t        j                  t        |«      j                  | «      S )zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r	   ÚfilterfalseÚsetÚ__contains__)ÚminuendÚ
subtrahends     r   Ú_differencer   ?   s!   € ô
 × Ñ ¤ Z£×!=Ñ!=¸wÓGÐGr   c                   óN   ‡ — e Zd ZdZed„ «       Zˆ fd„Zd„ Zd„ Ze	d„ «       Z
ˆ xZS )ÚCompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    c                 ó˜   — t         j                  j                  t        t        | «      «      }d„ |D «       }t        t        || «      «      S )Nc              3   óB   K  — | ]  }|t         j                  z   –— Œ y ­w©N)r   r   )Ú.0Úps     r   ú	<genexpr>z-CompleteDirs._implied_dirs.<locals>.<genexpr>P   s   è ø€ Ò6¨�1”y—}‘}Õ$Ñ6ùs   ‚)r	   ÚchainÚfrom_iterableÚmapr   Ú_deduper   )ÚnamesÚparentsÚas_dirss      r   Ú_implied_dirszCompleteDirs._implied_dirsM   s9   € ä—/‘/×/Ñ/´´H¸eÓ0DÓEˆÙ6¨gÔ6ˆÜ”{ 7¨EÓ2Ó3Ð3r   c                 ób   •— t         t        | �  «       }|t        | j	                  |«      «      z   S r"   )Úsuperr   ÚnamelistÚlistr-   )Úselfr*   Ú	__class__s     €r   r0   zCompleteDirs.namelistS   s-   ø€ Ü”l DÑ2Ó4ˆØ”t˜D×.Ñ.¨uÓ5Ó6Ñ6Ð6r   c                 ó4   — t        | j                  «       «      S r"   )r   r0   ©r2   s    r   Ú	_name_setzCompleteDirs._name_setW   s   € Ü�4—=‘=“?Ó#Ð#r   c                 óL   — | j                  «       }|dz   }||vxr ||v }|r|S |S )zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        ú/)r6   )r2   Únamer*   ÚdirnameÚ	dir_matchs        r   Úresolve_dirzCompleteDirs.resolve_dirZ   s:   € ð
 —‘Ó ˆØ˜‘*ˆØ Ð%Ò:¨'°UÐ*:ˆ	Ù#ˆwÐ-¨Ð-r   c                 ó¶   — t        |t        «      r|S t        |t        j                  «      s | t	        |«      «      S d|j
                  vrt        } | |_        |S )zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        Úr)Ú
isinstancer   ÚzipfileÚZipFileÚ_pathlib_compatÚmoder3   )ÚclsÚsources     r   ÚmakezCompleteDirs.maked   sQ   € ô �fœlÔ+ØˆMä˜&¤'§/¡/Ô2Ù” vÓ.Ó/Ð/ð �f—k‘kÑ!ÜˆCàˆÔØˆr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr-   r0   r6   r<   ÚclassmethodrF   Ú__classcell__©r3   s   @r   r   r   G   s?   ø„ ñð
 ñ4ó ð4ô
7ò$ò.ð ñó ôr   r   c                   ó,   ‡ — e Zd ZdZˆ fd„Zˆ fd„Zˆ xZS )Ú
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c                 óÀ   •— t        j                  t        «      5  | j                  cd d d «       S # 1 sw Y   nxY wt        t
        | �  «       | _        | j                  S r"   )Ú
contextlibÚsuppressÚAttributeErrorÚ_FastLookup__namesr/   rP   r0   ©r2   r3   s    €r   r0   zFastLookup.namelist~   sH   ø€ Ü× Ñ ¤Ó0ñ 	 Ø—<‘<÷	 ÷ 	 ò 	 úäœZ¨Ñ7Ó9ˆŒØ�|‰|Ðó   ›1±:c                 óÀ   •— t        j                  t        «      5  | j                  cd d d «       S # 1 sw Y   nxY wt        t
        | �  «       | _        | j                  S r"   )rR   rS   rT   Ú_FastLookup__lookupr/   rP   r6   rV   s    €r   r6   zFastLookup._name_set„   sH   ø€ Ü× Ñ ¤Ó0ñ 	!Ø—=‘=÷	!÷ 	!ò 	!úäœj¨$Ñ9Ó;ˆŒØ�}‰}ÐrW   )rG   rH   rI   rJ   r0   r6   rM   rN   s   @r   rP   rP   x   s   ø„ ñô
÷ð r   rP   c                 óX   — 	 | j                  «       S # t        $ r t        | «      cY S w xY w)zi
    For path-like objects, convert to a filename for compatibility
    on Python 3.6.1 and earlier.
    )Ú
__fspath__rT   Ústrr   s    r   rB   rB   ‹   s-   € ð
Ø�‰Ó Ð øÜò Ü�4‹yÒðús   ‚ ’)¨)c                   óÐ   — e Zd ZdZdZdd„Zdddœd„Zed„ «       Zed„ «       Z	ed	„ «       Z
ed
„ «       Zed„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZeZed„ «       Zy)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                 óF   — t         j                  |«      | _        || _        y)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)rP   rF   ÚrootÚat)r2   r_   r`   s      r   Ú__init__zPath.__init__æ   s   € ô —O‘O DÓ)ˆŒ	Øˆ�r   N©Úpwdc                ó.  — | j                  «       rt        | «      ‚|d   }| j                  «       s|dk(  rt        | «      ‚| j                  j                  | j                  ||¬«      }d|v r|s|rt        d«      ‚|S t        j                  |g|¢­i |¤ŽS )zª
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        r   r>   rb   Úbz*encoding args invalid for binary operation)
Úis_dirÚIsADirectoryErrorÚexistsÚFileNotFoundErrorr_   Úopenr`   Ú
ValueErrorÚioÚTextIOWrapper)r2   rC   rc   ÚargsÚkwargsÚzip_modeÚstreams          r   rj   z	Path.openó   s�   € ð �;‰;Œ=Ü# DÓ)Ð)Ø˜‘7ˆØ�{‰{Œ} ¨S¢Ü# DÓ)Ð)Ø—‘—‘ §¡¨°s�Ó;ˆØ�$‰;Ù‘vÜ Ð!MÓNÐNØˆMÜ×Ñ Ð8¨Ò8°Ñ8Ð8r   c                 ó„   — t        j                  | j                  «      j                  xs | j                  j                  S r"   )Úpathlibr   r`   r9   Úfilenamer5   s    r   r9   z	Path.name  ó*   € ä�|‰|˜DŸG™GÓ$×)Ñ)Ò?¨T¯]©]×-?Ñ-?Ð?r   c                 ó„   — t        j                  | j                  «      j                  xs | j                  j                  S r"   )rs   r   r`   Úsuffixrt   r5   s    r   rw   zPath.suffix	  s*   € ä�|‰|˜DŸG™GÓ$×+Ñ+ÒC¨t¯}©}×/CÑ/CÐCr   c                 ó„   — t        j                  | j                  «      j                  xs | j                  j                  S r"   )rs   r   r`   Úsuffixesrt   r5   s    r   ry   zPath.suffixes  s*   € ä�|‰|˜DŸG™GÓ$×-Ñ-ÒG°·±×1GÑ1GÐGr   c                 ó„   — t        j                  | j                  «      j                  xs | j                  j                  S r"   )rs   r   r`   Ústemrt   r5   s    r   r{   z	Path.stem  ru   r   c                 ó†   — t        j                  | j                  j                  «      j	                  | j
                  «      S r"   )rs   r   r_   rt   Újoinpathr`   r5   s    r   rt   zPath.filename  s*   € ä�|‰|˜DŸI™I×.Ñ.Ó/×8Ñ8¸¿¹ÓAÐAr   c                 óz   —  | j                   dg|¢­i |¤Ž5 }|j                  «       cd d d «       S # 1 sw Y   y xY w)Nr>   ©rj   Úread)r2   rn   ro   Ústrms       r   Ú	read_textzPath.read_text  s:   € ØˆT�Y‰Y�sÐ,˜TÒ, VÑ,ð 	°Ø—9‘9“;÷	÷ 	ò 	ús   —1±:c                 óp   — | j                  d«      5 }|j                  «       cd d d «       S # 1 sw Y   y xY w)NÚrbr   )r2   r�   s     r   Ú
read_byteszPath.read_bytes  s-   € Ø�Y‰Y�t‹_ð 	 Ø—9‘9“;÷	÷ 	ò 	ús   ’,¬5c                 ó–   — t        j                  |j                  j                  d«      «      | j                  j                  d«      k(  S ©Nr8   )r   r:   r`   r   )r2   r   s     r   Ú	_is_childzPath._is_child!  s2   € Ü× Ñ  §¡§¡°Ó!4Ó5¸¿¹¿¹ÈÓ9LÑLÐLr   c                 ó:   — | j                  | j                  |«      S r"   )r3   r_   )r2   r`   s     r   Ú_nextz
Path._next$  s   € Ø�~‰~˜dŸi™i¨Ó,Ð,r   c                 óV   — | j                    xs | j                   j                  d«      S r‡   )r`   Úendswithr5   s    r   rf   zPath.is_dir'  s"   € Ø—7‘7ˆ{Ò3˜dŸg™g×.Ñ.¨sÓ3Ð3r   c                 óH   — | j                  «       xr | j                  «        S r"   )rh   rf   r5   s    r   Úis_filezPath.is_file*  s   € Ø�{‰{‹}Ò2 T§[¡[£]Ð!2Ð2r   c                 óN   — | j                   | j                  j                  «       v S r"   )r`   r_   r6   r5   s    r   rh   zPath.exists-  s   € Ø�w‰w˜$Ÿ)™)×-Ñ-Ó/Ð/Ð/r   c                 óÀ   — | j                  «       st        d«      ‚t        | j                  | j                  j                  «       «      }t        | j                  |«      S )NzCan't listdir a file)rf   rk   r(   rŠ   r_   r0   Úfilterrˆ   )r2   Úsubss     r   ÚiterdirzPath.iterdir0  sE   € Ø�{‰{Œ}ÜÐ3Ó4Ð4Ü�4—:‘:˜tŸy™y×1Ñ1Ó3Ó4ˆÜ�d—n‘n dÓ+Ð+r   c                 ój   — t        j                  | j                  j                  | j                  «      S r"   )r   Újoinr_   rt   r`   r5   s    r   Ú__str__zPath.__str__6  s!   € Ü�~‰~˜dŸi™i×0Ñ0°$·'±'Ó:Ð:r   c                 ó:   — | j                   j                  | ¬«      S )Nr5   )Ú_Path__reprÚformatr5   s    r   Ú__repr__zPath.__repr__9  s   € Ø�{‰{×!Ñ! tÐ!Ó,Ð,r   c                 ó²   — t        j                  | j                  gt        t        |«      ¢­Ž }| j                  | j                  j                  |«      «      S r"   )r   r•   r`   r(   rB   rŠ   r_   r<   )r2   ÚotherÚnexts      r   r}   zPath.joinpath<  s>   € Ü�~‰~˜dŸg™gÐD¬¬O¸UÓ(CÒDˆØ�z‰z˜$Ÿ)™)×/Ñ/°Ó5Ó6Ð6r   c                 óÒ   — | j                   s| j                  j                  S t        j                  | j                   j                  d«      «      }|r|dz  }| j                  |«      S r‡   )r`   rt   Úparentr   r:   r   rŠ   )r2   Ú	parent_ats     r   rŸ   zPath.parentB  sR   € à�wŠwØ—=‘=×'Ñ'Ð'Ü×%Ñ% d§g¡g§n¡n°SÓ&9Ó:ˆ	ÙØ˜ÑˆIØ�z‰z˜)Ó$Ð$r   )Ú )r>   )rG   rH   rI   rJ   r˜   ra   rj   Úpropertyr9   rw   ry   r{   rt   r‚   r…   rˆ   rŠ   rf   rŽ   rh   r“   r–   rš   r}   Ú__truediv__rŸ   © r   r   r   r   –   sá   „ ñKðZ N€Fóð9¨ô 9ð$ ñ@ó ð@ð ñDó ðDð ñHó ðHð ñ@ó ð@ð ñBó ðBòòòMò-ò4ò3ò0ò,ò;ò-ò7ð €Kàñ%ó ñ%r   )rl   r   r@   r	   rR   Úsysrs   Úversion_infoÚcollectionsr   ÚdictÚ__all__r   r   Úfromkeysr)   r   rA   r   rP   rB   r   r¤   r   r   ú<module>r«      s‡   ðÛ 	Û Û Û Û Û 
Û à×Ñ�fÒÞ'à€Kð ˆ(€ò6ò&+ð, ×
Ñ
€Ø /òHô.�7—?‘?ô .ôb�ô ò&÷s%ò s%r   