+
    üÐjÐ%  ã                   ó®   € R t ^ RIt^ RIt^ RIt^ RIt ! R R]P                  4      t ! R R4      t ! R R]4      t	 ! R R	]4      t
^tR
 tR tRR ltR# )zŸ
An incremental approach to unzipping files.  This allows you to unzip a little
bit of a file at a time, which means you can report progress as a file unzips.
Nc                   ó*   a € ] tR t^t o RtR tRtV tR# )ÚChunkingZipFilezr
A L{zipfile.ZipFile} object which, with L{readfile}, also gives you access
to a file-like object for each entry.
c                óè  € V P                   R9  d   \        R4      hV P                  '       g   \        R4      hV P                  V4      pV P                  P	                  VP
                  ^ 4       V P                  P                  \        P                  4      pVR,          \        P                  8w  d   \        P                  ! R4      h\        P                  ! \        P                  V4      pV P                  P                  V\        P                  ,          4      pV\        P                  ,          '       d1   V P                  P                  V\        P                  ,          4       VP                   R,          '       d   VP#                  R4      pMVP#                  R4      pWRP$                  8w  d*   \        P                  ! RVP$                  : R	V: R
24      hVP&                  \        P(                  8X  d   \+        WP,                  4      # VP&                  \        P.                  8X  d   \1        WP,                  4      # \        P                  ! RVP&                  V3,          4      h)z#
Return file-like object for name.
zread() requires mode "r" or "a"z3Attempt to read ZIP archive that was already closed:é    é   Nz Bad magic number for file headeri   zutf-8Úcp437zFile name in directory "z" and header "z	" differ.z-Unsupported compression method %d for file %s)ÚrÚa)ÚmodeÚRuntimeErrorÚfpÚgetinfoÚseekÚheader_offsetÚreadÚzipfileÚsizeFileHeaderÚstringFileHeaderÚ
BadZipFileÚstructÚunpackÚstructFileHeaderÚ_FH_FILENAME_LENGTHÚ_FH_EXTRA_FIELD_LENGTHÚ	flag_bitsÚdecodeÚorig_filenameÚcompress_typeÚ
ZIP_STOREDÚZipFileEntryÚcompress_sizeÚZIP_DEFLATEDÚDeflatedZipFileEntry)ÚselfÚnameÚzinfoÚfheaderÚfnameÚ	fname_strs   &&    Ú:/usr/lib/python3/dist-packages/twisted/python/zipstream.pyÚreadfileÚChunkingZipFile.readfile   sÁ  € ð �9‰9˜JÔ&ÜÐ@ÓAÐAØ�w�wˆwÜÐTÓUÐUØ—‘˜TÓ"ˆà�‰�‰�U×(Ñ(¨!Ô,à—'‘'—,‘,œw×5Ñ5Ó6ˆØ�3�<œ7×3Ñ3Ô3Ü×$Ò$Ð%GÓHÐHä—-’-¤× 8Ñ 8¸'ÓBˆØ—‘—‘˜W¤W×%@Ñ%@ÕAÓBˆà”7×1Ñ1×2Ô2Ø�G‰G�L‰L˜¤×!?Ñ!?Õ@ÔAà�?‰?˜U×"Ô"àŸ™ WÓ-‰IàŸ™ WÓ-ˆIà×+Ñ+Ô+Ü×$Ó$à×&Ô&«	ð3óð ð
 ×Ñ¤'×"4Ñ"4Ô4Ü ×&9Ñ&9Ó:Ð:Ø× Ñ ¤G×$8Ñ$8Ô8Ü'¨×.AÑ.AÓBÐBä×$Ò$Ø?Ø×&Ñ&¨Ð-õ.óð ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r*   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r)   r   r      s   ø‡ € ñ÷
*ð *r,   r   c                   ód   a € ] tR t^Ct o RtR tR tR tR tR t	]	t
R tR tR	 tR
 tR tRtV tR# )Ú
_FileEntryaá  
Abstract superclass of both compressed and uncompressed variants of
file-like objects within a zip archive.

@ivar chunkingZipFile: a chunking zip file.
@type chunkingZipFile: L{ChunkingZipFile}

@ivar length: The number of bytes within the zip file that represent this
file.  (This is the size on disk, not the number of decompressed bytes
which will result from reading it.)

@ivar fp: the underlying file object (that contains pkzip data).  Do not
touch this, please.  It will quite likely move or go away.

@ivar closed: File-like 'closed' attribute; True before this file has been
closed, False after.
@type closed: L{bool}

@ivar finished: An older, broken synonym for 'closed'.  Do not touch this,
please.
@type finished: L{int}
c                óp   € Wn         V P                   P                  V n        W n        ^ V n        RV n        R# )z3
Create a L{_FileEntry} from a L{ChunkingZipFile}.
FN)ÚchunkingZipFiler   ÚlengthÚfinishedÚclosed©r#   r:   r;   s   &&&r)   Ú__init__Ú_FileEntry.__init__[   s0   € ð  /ÔØ×&Ñ&×)Ñ)ˆŒØŒØˆŒØˆŽr,   c                ó   € R# )z4
Returns false because zip files should not be ttys
Fr-   ©r#   s   &r)   ÚisattyÚ_FileEntry.isattye   s   € ñ r,   c                ó&   € RV n         ^V n        V =R# )z
Close self (file-like object)
TN)r=   r<   r   rB   s   &r)   ÚcloseÚ_FileEntry.closek   s   € ð ˆŒØˆŒØŠGr,   c                ó^   a € Rp\        V 3R lR4       F  pW,          pVR8X  g   K   V# 	  V# )z
Read a line.
r,   c                  ó&   <€ S P                  ^4      # )é   )r   rB   s   €r)   Ú<lambda>Ú%_FileEntry.readline.<locals>.<lambda>x   s   ø€  §¡¨1¤r,   ó   
)Úiter)r#   ÚlineÚbytes   f  r)   ÚreadlineÚ_FileEntry.readlines   s9   ø€ ð ˆÜÔ-¨sÖ3ˆDØ�LˆDØ�uŽ}ØØˆñ	 4ð ˆr,   c                óJ   € V P                  4       pV'       d   V# \        4       h)zQ
Implement next as file does (like readline, except raises StopIteration
at EOF)
)rQ   ÚStopIteration)r#   Únextlines   & r)   Ú__next__Ú_FileEntry.__next__~   s   € ð
 —=‘=“?ˆßØˆOÜ‹oÐr,   c                ó   € \        V 4      # )z!
Returns a list of all the lines
)ÚlistrB   s   &r)   Ú	readlinesÚ_FileEntry.readlines‹   s   € ô �D‹zÐr,   c                ó   € V # ©z
Returns an iterator (so self)
r-   rB   s   &r)   Ú
xreadlinesÚ_FileEntry.xreadlines‘   ó	   € ð ˆr,   c                ó   € V # r]   r-   rB   s   &r)   Ú__iter__Ú_FileEntry.__iter__—   r`   r,   c                ó   € V # ©Nr-   rB   s   &r)   Ú	__enter__Ú_FileEntry.__enter__�   s   € Øˆr,   c                ó&   € V P                  4        R # re   )rF   )r#   Úexc_typeÚ	exc_valueÚ	tracebacks   &&&&r)   Ú__exit__Ú_FileEntry.__exit__    s   € Ø�
‰
Žr,   )r:   r=   r<   r   r;   N)r.   r/   r0   r1   r2   r?   rC   rF   rQ   rV   ÚnextrZ   r^   rb   rf   rl   r3   r4   r5   s   @r)   r8   r8   C   sH   ø‡ € ñò.òòò	òð €Dòòòò÷ð r,   r8   c                   ó:   a € ] tR t^¤t o RtR tR tRR ltRtV t	R# )r   zB
File-like object used to read an uncompressed entry in a ZipFile
c                ó@   € \         P                  WV4       ^ V n        R# )r   N)r8   r?   Ú	readBytesr>   s   &&&r)   r?   ÚZipFileEntry.__init__©   s   € Ü×Ñ˜D°6Ô:ØˆŽr,   c                ó   € V P                   # re   )rq   rB   s   &r)   ÚtellÚZipFileEntry.tell­   s   € Ø�~‰~Ðr,   Nc                ó¸  € Vf   V P                   V P                  ,
          pV^ 8X  g   V P                  '       d   R# V P                  P                  P                  \        WP                   V P                  ,
          4      4      pV ;P                  \        V4      ,          un        V P                  V P                   8X  g   \        V4      V8  d   ^V n        V# )Nr,   )r;   rq   r<   r:   r   r   ÚminÚlen)r#   ÚnÚdatas   && r)   r   ÚZipFileEntry.read°   s‘   € ØŠ9Ø—‘˜dŸn™nÕ,ˆAØ�Œ6�T—]—]�]ÙØ×#Ñ#×&Ñ&×+Ñ+¬C°·;±;ÀÇÁÕ3OÓ,PÓQˆØ�Šœ#˜d›)Õ#�Ø�>‰>˜TŸ[™[Ô(¬C°«I¸¬MØˆDŒMØˆr,   )r<   rq   re   ©
r.   r/   r0   r1   r2   r?   rt   r   r3   r4   r5   s   @r)   r   r   ¤   s   ø‡ € ñòò÷	ò 	r,   r   c                   ó:   a € ] tR t^¼t o RtR tR tRR ltRtV t	R# )r"   z=
File-like object used to read a deflated entry in a ZipFile
c                ó’   € \         P                  WV4       ^ V n        ^ V n        \        P
                  ! R4      V n        RV n        R# )r   r,   Niñÿÿÿ)r8   r?   ÚreturnedBytesrq   ÚzlibÚdecompressobjÚdecompÚbufferr>   s   &&&r)   r?   ÚDeflatedZipFileEntry.__init__Á   s:   € Ü×Ñ˜D°6Ô:ØˆÔØˆŒÜ×(Ò(¨Ó-ˆŒØˆŽr,   c                ó   € V P                   # re   )r   rB   s   &r)   rt   ÚDeflatedZipFileEntry.tellÈ   s   € Ø×!Ñ!Ð!r,   Nc                ó\  € V P                   '       d   R # VEf   V P                  .pVP                  V P                  P	                  V P
                  P                  P                  V P                  V P                  ,
          4      4      4       VP                  V P                  P	                  R4      4       VP                  V P                  P                  4       4       R V n        ^V n         R P                  V4      pV ;P                  \        V4      ,          un        V# \        V P                  4      V8  Ed(   V P
                  P                  P                  \        VRV P                  V P                  ,
          4      4      pV ;P                  \        V4      ,          un	        V'       g~   V P                  V P                  P	                  R4      ,           V P                  P                  4       ,           p^V n         R V n        V ;P                  \        V4      ,          un        V# V ;P                  V P                  P	                  V4      ,          un        EKB  V P                  RV pV P                  VR V n        V ;P                  \        V4      ,          un        V# )r,   Nó   Zi   )r<   rƒ   Úappendr‚   Ú
decompressr:   r   r   r;   rq   ÚflushÚjoinr   rx   rw   )r#   ry   Úresultrz   s   &&  r)   r   ÚDeflatedZipFileEntry.readË   sæ  € Ø�=�=ˆ=ÙØ‹9à—‘ðˆFð �M‰MØ—‘×&Ñ&Ø×(Ñ(×+Ñ+×0Ñ0°·±¸t¿~¹~Õ1MÓNóôð
 �M‰M˜$Ÿ+™+×0Ñ0°Ó6Ô7Ø�M‰M˜$Ÿ+™+×+Ñ+Ó-Ô.ØˆDŒKØˆDŒMØ—X‘X˜fÓ%ˆFØ×Ò¤# f£+Õ-ÕØˆMä�d—k‘kÓ" QÕ&Ø×+Ñ+×.Ñ.×3Ñ3Ü˜˜4 §¡¨t¯~©~Õ!=Ó>ó�ð —’¤# d£)Õ+•ßàŸ™ d§k¡k×&<Ñ&<¸TÓ&BÕBÀTÇ[Á[×EVÑEVÓEXÕXð ð %&�D”MØ"%�D”KØ×&Ò&¬#¨f«+Õ5Õ&Ø!�Mà—K’K 4§;¡;×#9Ñ#9¸$Ó#?Õ?—K�KØ—[‘[  !�_ˆFØŸ+™+ a b˜/ˆDŒKØ×Ò¤# f£+Õ-ÕØˆMr,   )rƒ   r‚   r<   rq   r   re   r|   r5   s   @r)   r"   r"   ¼   s   ø‡ € ñòò"÷&ò &r,   r"   c                ór   € ^ p\        V 4      pVP                  4        F  pV\        WA4      ,          pK  	  V# )zf
Predict the number of chunks that will be extracted from the entire
zipfile, given chunksize blocks.
)r   ÚinfolistÚcountFileChunks)ÚfilenameÚ	chunksizeÚtotalchunksÚzfÚinfos   &&   r)   ÚcountZipFileChunksr—   ÷   s8   € ð
 €KÜ	˜Ó	"€BØ—‘–ˆØ” tÓ7Õ7Šñ àÐr,   c                ój   € \        V P                  V4      w  r#V^ 8”  d
   V^,          pT;'       g    ^# )a  
Count the number of chunks that will result from the given C{ZipInfo}.

@param zipinfo: a C{zipfile.ZipInfo} instance describing an entry in a zip
archive to be counted.

@return: the number of chunks present in the zip file.  (Even an empty file
counts as one chunk.)
@rtype: L{int}
)ÚdivmodÚ	file_size)Úzipinfor“   ÚcountÚextras   &&  r)   r‘   r‘     s4   € ô ˜'×+Ñ+¨YÓ7�L€EØˆq„yØ��
ˆØ�:ˆ:�AÐr,   c              #  óà  "  € \        V R4      p\        P                  P                  V4      '       g   \        P                  ! V4       \        W4      pVP                  4       pVP                  4       p\        Wg4       EFÒ  w  r‰V	P                  \        ,          p
\        P                  P                  W4      pV
'       dK   \        P                  P                  V4      '       g   \        P                  ! V4       V^,          pVx € KŽ  \        P                  P                  V4      ^ ,          p\        P                  P                  V4      '       g   \        P                  ! V4       V'       g&   \        P                  P                  V4      '       g¡   VP                  V4      pV	P                  ^ 8X  d   V^,          pVx € \        VR4      ;_uu_ 4       pVP!                  4       V	P                  8  d2   VP#                  V4      pVP%                  V4       V^,          pVx € KP   RRR4       EK¼  V\'        W“4      ,          pVx € EKÕ  	  R#   + '       g   i     EKë  ; i5i)zÛ
Return a generator for the zipfile.  This implementation will yield after
every chunksize uncompressed bytes, or at the end of a file, whichever
comes first.

The value it yields is the number of chunks left to unzip.
r   ÚwbN)r   ÚosÚpathÚexistsÚmakedirsr—   Únamelistr�   ÚzipÚexternal_attrÚDIR_BITrŒ   Úsplitr*   rš   Úopenrt   r   Úwriter‘   )r’   Ú	directoryÚ	overwriter“   ÚczfÚ	remainingÚnamesÚinfosÚentryr–   ÚisdirÚfÚfdirr   ÚoutfileÚhunks   &&&&            r)   ÚunzipIterChunkyr·     s›  é € ô ˜( CÓ
(€CÜ�7‰7�>‰>˜)×$Ò$Ü
�Š�IÔÜ" 8Ó7€IØ�L‰L‹N€EØ�L‰L‹N€Eä˜5×(‰ˆØ×"Ñ"¤WÕ,ˆÜ�G‰G�L‰L˜Ó*ˆßä—7‘7—>‘> !×$Ò$Ü—’˜A”Ø˜�NˆIØŒOô —7‘7—=‘= Ó# AÕ&ˆDÜ—7‘7—>‘> $×'Ò'Ü—’˜DÔ!ß¤§¡§¡¨q× 1Ò 1Ø—\‘\ %Ó(�Ø—>‘> QÔ&Ø •N�IØ#’OÜ˜!˜T—]”] gØŸ'™'›) d§n¡nÔ4Ø!Ÿw™w yÓ1˜ØŸ™ dÔ+Ø! Q�˜	Ø'œð	 5÷ #’]ð œ_¨TÓ=Õ=�	Ø•ó9 )÷( #—]‘]üs9   ‚C&I.Ã)A/I.ÅI.Å7$I.ÆAI.ÇAIÈ1(I.ÉI+É$
I.)Ú.r   i   )r2   Úos.pathr    r   r   r€   ÚZipFiler   r8   r   r"   r§   r—   r‘   r·   r-   r,   r)   Ú<module>r»      se   ðñ
ó
 Û Û Û ô0�g—o‘oô 0÷f^ñ ^ôB�:ô ô05˜:ô 5ðp €ò	òö"+ r,   