+
    §ùCiÈ.  ã                   ó  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^RI
Ht ^RIHt ^RIHt R.tR tR t]P(                  t R t ! R	 R
4      t ! R R]]	P0                  4      t ! R R]4      tRR lt ! R R4      tR# )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)Úsave_method_args)Útext_encoding)Ú
TranslatorÚPathc                óD   € \         P                  ! \        V 4      ^R4      # )zþ
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   &Ú//usr/lib/python3/dist-packages/zipp/__init__.pyÚ_parentsr      s   € ô  ×ÒœI d›O¨Q°Ó5Ð5ó    c              #  óÒ   "  € V P                  \        P                  4      p V P                  \        P                  4      '       d   V x € \        P                  ! V 4      w  rKC  R# 5i)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
   Útails   & r   r	   r	   .   sH   é € ð* �;‰;”y—}‘}Ó%€DØ
�+‰+”i—m‘m×
$Ò
$ØŠ
Ü—_’_ TÓ*‰
ˆ‰dñ %ùs   ‚AA'Á A'c                óV   € \         P                  ! \        V4      P                  V 4      # )zN
Return items in minuend not in subtrahend, retaining order
with O(1) lookup.
)r   ÚfilterfalseÚsetÚ__contains__)ÚminuendÚ
subtrahends   &&r   Ú_differencer   M   s!   € ô
 × Ò ¤ Z£×!=Ñ!=¸wÓGÐGr   c                   óR   a a€ ] tR t^Ut oRt]V 3R l4       tR tV 3R ltRt	Vt
V ;t# )ÚInitializedStatez7
Mix-in to save the initialization state for pickling.
c                ó(   <€ \         SV `  ! V/ VB  R # ©N©ÚsuperÚ__init__)ÚselfÚargsÚkwargsÚ	__class__s   &*,€r   r!   ÚInitializedState.__init__Z   s   ø€ ä‰Ò˜$Ð) &Ô)r   c                óZ   € V P                   P                  V P                   P                  3# r   )Ú_saved___init__r#   r$   ©r"   s   &r   Ú__getstate__ÚInitializedState.__getstate__^   s%   € Ø×#Ñ#×(Ñ(¨$×*>Ñ*>×*EÑ*EÐEÐEr   c                ó0   <€ Vw  r#\         SV `  ! V/ VB  R # r   r   )r"   Ústater#   r$   r%   s   &&  €r   Ú__setstate__ÚInitializedState.__setstate__a   s   ø€ Ø‰ˆÜ‰Ò˜$Ð) &Ô)r   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r!   r*   r.   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r%   Ú__classdict__s   @@r   r   r   U   s.   ù‡ € ñð ô*ó ð*òF÷*õ *r   r   c                   óŠ   a a€ ] tR t^ft oRt]R 4       tV 3R ltR tR t	V 3R lt
]R 4       t]V3R lR	 l4       tR
tVtV ;t# )ÚCompleteDirsa  
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/']
c                ó–   € \         P                  P                  \        \        V 4      4      pR  V 4       p\        \        W 4      4      # )c              3   óN   "  € T F  q\         P                  ,           x € K  	  R # 5ir   )r   r   )Ú.0Úps   & r   Ú	<genexpr>Ú-CompleteDirs._implied_dirs.<locals>.<genexpr>t   s   é € Ð6©g¨”y—}‘}×$Ò$«gùs   ‚#%)r   ÚchainÚfrom_iterableÚmapr   Ú_deduper   )ÚnamesÚparentsÚas_dirss   &  r   Ú_implied_dirsÚCompleteDirs._implied_dirsq   s7   € ä—/‘/×/Ñ/´´H¸eÓ0DÓEˆÙ6©gÓ6ˆÜ”{ 7Ó2Ó3Ð3r   c                ób   <€ \         SV `  4       pV\        V P                  V4      4      ,           # r   )r    ÚnamelistÚlistrJ   )r"   rG   r%   s   & €r   rM   ÚCompleteDirs.namelistw   s+   ø€ Ü‘Ñ Ó"ˆØ”t˜D×.Ñ.¨uÓ5Ó6Õ6Ð6r   c                ó4   € \        V P                  4       4      # r   )r   rM   r)   s   &r   Ú	_name_setÚCompleteDirs._name_set{   s   € Ü�4—=‘=“?Ó#Ð#r   c                ól   € V P                  4       pVR,           pW9  ;'       d    W29   pV'       d   V# T# )z`
If the name represents a directory, return that name
as a directory (with the trailing slash).
Ú/)rQ   )r"   ÚnamerG   ÚdirnameÚ	dir_matchs   &&   r   Úresolve_dirÚCompleteDirs.resolve_dir~   s9   € ð
 —‘Ó ˆØ˜•*ˆØÑ%×:Ð:¨'Ñ*:ˆ	ß#ˆwÐ-¨Ð-r   c                óÌ   <€  \         SV `  V4      #   \         dG    TP                  R4      '       d   YP	                  4       9  d   h \
        P                  ! TR7      u # i ; i)z&
Supplement getinfo for implied dirs.
rT   )Úfilename)r    ÚgetinfoÚKeyErrorÚendswithrQ   ÚzipfileÚZipInfo)r"   rU   r%   s   &&€r   r\   ÚCompleteDirs.getinfoˆ   sS   ø€ ð	2Ü‘7‘? 4Ó(Ð(øÜô 	2Ø—=‘= ×%Ò%¨·^±^Ó5EÔ)EØÜ—?’?¨DÔ1Ò1ð	2ús   ƒ ’!A#´,A#Á"A#c                óÀ   € \        V\        4      '       d   V# \        V\        P                  4      '       g	   V ! V4      # RVP                  9  d   \        p Wn        V# )zT
Given a source (filename or zipfile), return an
appropriate CompleteDirs subclass.
Úr)Ú
isinstancer<   r_   ÚZipFileÚmoder%   )ÚclsÚsources   &&r   ÚmakeÚCompleteDirs.make“   sO   € ô �fœl×+Ò+ØˆMä˜&¤'§/¡/×2Ò2Ù�v“;Ðð �f—k‘kÔ!ÜˆCàÔØˆr   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )é   ÚzfÚreturn)r_   re   )Úformatr:   s   "€r   Ú__annotate__ÚCompleteDirs.__annotate__§   s#   ø€ ÷ ñ ™Ÿ™ð ©G¯O©Oñ r   c                óv   € V P                  VP                  4       4       F  pVP                  VR4       K  	  V# )zq
Given a writable zip file zf, inject directory entries for
any directories implied by the presence of children.
r   )rJ   rM   Úwritestr)rg   rm   rU   s   && r   ÚinjectÚCompleteDirs.inject¦   s2   € ð ×%Ñ% b§k¡k£mÖ4ˆDØ�K‰K˜˜cÖ"ñ 5àˆ	r   r0   )r1   r2   r3   r4   r5   ÚstaticmethodrJ   rM   rQ   rX   r\   Úclassmethodri   rt   r6   r7   r8   r9   s   @@r   r<   r<   f   s_   ù‡ € ñð ñ4ó ð4õ
7ò$ò.õ	2ð ñó ðð$ ÷ó ÷ð r   r<   c                   óŠ   a a€ ] tR t^±t oRtR t]P                  V 3R l4       tR t	]P                  V 3R l4       t
RtVtV ;t# )Ú
FastLookupzJ
ZipFile subclass to ensure implicit
dirs exist and are resolved rapidly.
c                ó   € V P                   # r   )Ú	_namelistr)   s   &r   rM   ÚFastLookup.namelist·   s   € Ø�~‰~Ðr   c                ó    <€ \         SV `  4       # r   )r    rM   ©r"   r%   s   &€r   r{   ÚFastLookup._namelistº   s   ø€ ä‰wÑÓ!Ð!r   c                ó   € V P                   # r   )Ú_name_set_propr)   s   &r   rQ   ÚFastLookup._name_set¾   s   € Ø×"Ñ"Ð"r   c                ó    <€ \         SV `  4       # r   )r    rQ   r~   s   &€r   r�   ÚFastLookup._name_set_propÁ   s   ø€ ä‰wÑ Ó"Ð"r   r0   )r1   r2   r3   r4   r5   rM   Ú	functoolsÚcached_propertyr{   rQ   r�   r6   r7   r8   r9   s   @@r   ry   ry   ±   sM   ù‡ € ñò
ð ×Ñô"ó ð"ò#ð ×Ñô#ó ÷#ð #r   ry   c                 ó¢   € \         P                  P                  R 8H  pT;'       d    \         P                  R8  p^V,           p\	        W4      W3# )Úpypy)é   é   é   )ÚsysÚimplementationrU   Úpypy_version_infor   )Úencodingr#   r$   Úis_pypyÚis_old_pypiÚstack_levels   &*,   r   Ú_extract_text_encodingr“   Æ   sK   € ä× Ñ ×%Ñ%¨Ñ/€Gð ×@Ð@œc×3Ñ3°jÑ@€KØ�k•/€KÜ˜Ó/°Ð=Ð=r   c                   ó  a € ] tR t^Ðt o RtRtR!R ltR tR tR"RR/R llt	R	 t
]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t ] t!]R 4       t"R t#V t$R# )#r   uü  
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})c                óF   € \         P                  V4      V n        W n        R# )a   
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)ry   ri   ÚrootÚat)r"   r–   r—   s   &&&r   r!   ÚPath.__init__9  s   € ô —O‘O DÓ)ˆŒ	ØŽr   c                ó¤   € V P                   VP                   Jd   \        # V P                  V P                  3VP                  VP                  38H  # )z=
>>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo'
False
)r%   ÚNotImplementedr–   r—   )r"   Úothers   &&r   Ú__eq__ÚPath.__eq__F  s?   € ð
 �>‰> §¡Ó0Ü!Ð!Ø—	‘	˜4Ÿ7™7Ð#¨¯
©
°E·H±HÐ'=Ñ=Ð=r   c                óD   € \        V P                  V P                  34      # r   )Úhashr–   r—   r)   s   &r   Ú__hash__ÚPath.__hash__O  s   € Ü�T—Y‘Y §¡Ð(Ó)Ð)r   ÚpwdNc               óŒ  € V P                  4       '       d   \        V 4      hV^ ,          pVR8X  d"   V P                  4       '       g   \        V 4      hV P                  P                  V P                  WRR7      pRV9   d   V'       g	   V'       d   \        R4      hV# \        V/ VB w  rsp\        P                  ! Wg.VO5/ VB # )zŠ
Open this entry as text or binary following the semantics
of ``pathlib.Path.open()`` by passing arguments through
to io.TextIOWrapper().
rc   )r¢   Úbz*encoding args invalid for binary operation)Úis_dirÚIsADirectoryErrorÚexistsÚFileNotFoundErrorr–   Úopenr—   Ú
ValueErrorr“   ÚioÚTextIOWrapper)r"   rf   r¢   r#   r$   Úzip_modeÚstreamr�   s   &&$*,   r   r©   Ú	Path.openR  s¥   € ð �;‰;�=Š=Ü# DÓ)Ð)Ø˜•7ˆØ�sŒ? 4§;¡;§=¢=Ü# DÓ)Ð)Ø—‘—‘ §¡¨�Ó;ˆØ�$Œ;ß—vÜ Ð!MÓNÐNØˆMä!7¸Ð!HÀÑ!HÑˆ˜Ü×Ò ÐB°4ÒB¸6ÑBÐBr   c                ó~   € V P                   '       d!   \        P                  ! V P                   4      # V P                  # r   )r—   ÚpathlibÚPurePosixPathr[   r)   s   &r   Ú_baseÚ
Path._basef  s(   € Ø15··°Œw×$Ò$ T§W¡WÓ-ÐK¸d¿m¹mÐKr   c                ó6   € V P                  4       P                  # r   )r³   rU   r)   s   &r   rU   Ú	Path.namei  ó   € à�z‰z‹|× Ñ Ð r   c                ó6   € V P                  4       P                  # r   )r³   Úsuffixr)   s   &r   r¹   ÚPath.suffixm  s   € à�z‰z‹|×"Ñ"Ð"r   c                ó6   € V P                  4       P                  # r   )r³   Úsuffixesr)   s   &r   r¼   ÚPath.suffixesq  s   € à�z‰z‹|×$Ñ$Ð$r   c                ó6   € V P                  4       P                  # r   )r³   Ústemr)   s   &r   r¿   Ú	Path.stemu  r·   r   c                óˆ   € \         P                  ! V P                  P                  4      P	                  V P
                  4      # r   )r±   r   r–   r[   Újoinpathr—   r)   s   &r   r[   ÚPath.filenamey  s*   € ä�|Š|˜DŸI™I×.Ñ.Ó/×8Ñ8¸¿¹ÓAÐAr   c                óº   € \        V/ VB w  r1pV P                  ! R V.VO5/ VB ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)rc   N)r“   r©   Úread)r"   r#   r$   r�   Ústrms   &*,  r   Ú	read_textÚPath.read_text}  sK   € Ü!7¸Ð!HÀÑ!HÑˆ˜Ø�YŠY�s˜HÐ6 tÒ6¨v×6Ò6¸$Ø—9‘9“;÷ 7×6×6Ó6ús   ®A	Á	A	c                ó’   € V P                  R 4      ;_uu_ 4       pVP                  4       uuRRR4       #   + '       g   i     R# ; i)ÚrbN)r©   rÅ   )r"   rÆ   s   & r   Ú
read_bytesÚPath.read_bytes‚  s&   € Ø�Y‰Y�t�_Œ_ Ø—9‘9“;÷ �_�_‹_ús	   š5µA	c                ó˜   € \         P                  ! VP                  P                  R 4      4      V P                  P                  R 4      8H  # ©rT   )r   rV   r—   r   )r"   r
   s   &&r   Ú	_is_childÚPath._is_child†  s2   € Ü× Ò  §¡§¡°Ó!4Ó5¸¿¹¿¹ÈÓ9LÑLÐLr   c                ó:   € V P                  V P                  V4      # r   )r%   r–   )r"   r—   s   &&r   Ú_nextÚ
Path._next‰  s   € Ø�~‰~˜dŸi™i¨Ó,Ð,r   c                ój   € V P                   '       * ;'       g    V P                   P                  R 4      # rÎ   )r—   r^   r)   s   &r   r¥   ÚPath.is_dirŒ  s%   € Ø—7‘7Œ{×3Ð3˜dŸg™g×.Ñ.¨sÓ3Ð3r   c                ó\   € V P                  4       ;'       d    V P                  4       '       * # r   )r§   r¥   r)   s   &r   Úis_fileÚPath.is_file�  s   € Ø�{‰{‹}×2Ð2 T§[¡[£]Ô!2Ð2r   c                óP   € V P                   V P                  P                  4       9   # r   )r—   r–   rQ   r)   s   &r   r§   ÚPath.exists’  s   € Ø�w‰w˜$Ÿ)™)×-Ñ-Ó/Ñ/Ð/r   c                óÌ   € V P                  4       '       g   \        R 4      h\        V P                  V P                  P                  4       4      p\        V P                  V4      # )zCan't listdir a file)r¥   rª   rE   rÒ   r–   rM   ÚfilterrÏ   )r"   Úsubss   & r   ÚiterdirÚPath.iterdir•  sG   € Ø�{‰{�}Š}ÜÐ3Ó4Ð4Ü�4—:‘:˜tŸy™y×1Ñ1Ó3Ó4ˆÜ�d—n‘n dÓ+Ð+r   c                ó`   € \         P                  ! V P                  4      P                  V4      # r   )r±   r²   r—   Úmatch)r"   Úpath_patterns   &&r   rá   Ú
Path.match›  s"   € Ü×$Ò$ T§W¡WÓ-×3Ñ3°LÓAÐAr   c                óž   € V P                   P                  V P                  4      pVP                  ^,	          p\        P
                  ! V4      # )z(
Return whether this path is a symlink.
)r–   r\   r—   Úexternal_attrÚstatÚS_ISLNK)r"   Úinforf   s   &  r   Ú
is_symlinkÚPath.is_symlinkž  s;   € ð �y‰y× Ñ  §¡Ó)ˆØ×!Ñ! RÕ'ˆÜ�|Š|˜DÓ!Ð!r   c                ó`  € V'       g   \        R V: 24      h\        P                  ! V P                  4      p\	        RR7      p\        P
                  ! W#P                  V4      ,           4      P                  p\        V P                  \        W@P                  P                  4       4      4      # )zUnacceptable pattern: rT   )Úseps)rª   ÚreÚescaper—   r   ÚcompileÚ	translateÚ	fullmatchrE   rÒ   rÜ   r–   rM   )r"   ÚpatternÚprefixÚtrÚmatchess   &&   r   ÚglobÚ	Path.glob¦  sw   € ßÜÐ5°g±[ÐAÓBÐBä—’˜4Ÿ7™7Ó#ˆÜ˜SÔ!ˆÜ—*’*˜V§l¡l°7Ó&;Õ;Ó<×FÑFˆÜ�4—:‘:œv g¯y©y×/AÑ/AÓ/CÓDÓEÐEr   c                ó*   € V P                  R V 24      # )z**/)rö   )r"   rò   s   &&r   ÚrglobÚ
Path.rglob¯  s   € Ø�y‰y˜3˜w˜i˜Ó)Ð)r   c           	     óp   € \         P                  ! \        V 4      \        VP                  ! V!  4      4      # r   )r   ÚrelpathÚstrrÂ   )r"   r›   Úextras   &&*r   Úrelative_toÚPath.relative_to²  s'   € Ü× Ò ¤ T£¬C°·²ÀÑ0FÓ,GÓHÐHr   c                ól   € \         P                  ! V P                  P                  V P                  4      # r   )r   Újoinr–   r[   r—   r)   s   &r   Ú__str__ÚPath.__str__µ  s!   € Ü�~Š~˜dŸi™i×0Ñ0°$·'±'Ó:Ð:r   c                ó:   € V P                   P                  V R 7      # )r)   )Ú_Path__reprro   r)   s   &r   Ú__repr__ÚPath.__repr__¸  s   € Ø�{‰{×!Ñ! tÐ!Ó,Ð,r   c                óš   € \         P                  ! V P                  .VO5!  pV P                  V P                  P                  V4      4      # r   )r   r  r—   rÒ   r–   rX   )r"   r›   Únexts   &* r   rÂ   ÚPath.joinpath»  s7   € Ü�~Š~˜dŸg™gÐ.¨Ó.ˆØ�z‰z˜$Ÿ)™)×/Ñ/°Ó5Ó6Ð6r   c                óô   € V P                   '       g   V P                  P                  # \        P                  ! V P                   P                  R 4      4      pV'       d
   VR ,          pV P                  V4      # rÎ   )r—   r[   Úparentr   rV   r   rÒ   )r"   Ú	parent_ats   & r   r  ÚPath.parentÁ  sT   € à�w�wˆwØ—=‘=×'Ñ'Ð'Ü×%Ò% d§g¡g§n¡n°SÓ&9Ó:ˆ	ßØ˜ÕˆIØ�z‰z˜)Ó$Ð$r   )r—   r–   )Ú )rc   )%r1   r2   r3   r4   r5   r  r!   rœ   r    r©   r³   ÚpropertyrU   r¹   r¼   r¿   r[   rÇ   rË   rÏ   rÒ   r¥   r×   r§   rÞ   rá   ré   rö   rù   rÿ   r  r  rÂ   Ú__truediv__r  r6   r7   )r:   s   @r   r   r   Ð   s
  ø‡ € ñdðL N€Fôò>ò*ñC¨õ Cò(Lð ñ!ó ð!ð ñ#ó ð#ð ñ%ó ð%ð ñ!ó ð!ð ñBó ðBòò
òMò-ò4ò3ò0ò,òBò"òFò*òIò;ò-ò7ð €Kàñ%ó ö%r   r   )r5   r…   r«   r   r±   r   rí   ræ   rŒ   r_   Ú
_functoolsr   Úcompat.py310r   rö   r   Ú__all__r   r	   ÚdictÚfromkeysrF   r   r   re   r<   ry   r“   r   r0   r   r   Ú<module>r     s’   ðñó Û 	Û Û Û Û 	Û Û 
Û å (Ý 'Ý àˆ(€ò6ò&+ð6 �-‰-€Ø /òH÷*ñ *ô"HÐ# W§_¡_ô HôV#�ô #ô*>÷x%ó x%r   