asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T a bYhU@sddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z zddlZejZWneydZejZYn0z ddlZWneydZYn0z ddlZWneydZYn0gdZGdddeZGdddeZeZZdZdZdZdZd Zd Zd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&e 'e%Z(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0d Z1dZ2dZ3dZ4e 'e3Z5dZ6dZ7dZ8dZ9dZ:dZ;dZdZ?dZ@dZAd ZBdZCd ZDdZEd ZFd!ZGd"ZHd#ZId$ZJe 'eIZKdZLdZMdZNdZOdZPdZQdZRdZSd ZTdZUdZVdZWd%ZXd&ZYe 'eXZZd'Z[d(Z\e 'e[Z]dZ^dZ_dZ`dZadZbdZcdZddZed ZfdZgd)Zhe id*Zjd+d,Zkd-d.Zld/d0Zmd1d2Znd3d4ZoGd5d6d6epZqdard7d8Zsd9d:ZtGd;d<d<ZuGd=d>d>Zvd?d@dAdAdAdAdBdCdDdEdBdFdGdHdIdJdKdLZwdMdNZxdndOdPZydQdRZzGdSdTdTZ{GdUdVdVZ|GdWdXdXej}Z~GdYdZdZej}ZGd[d\d\ZGd]d^d^eZd_d`ZdadbZejZdcddZGdedfdfeZGdgdhdheZGdidjdjZdodkdlZedmkredS)pN) BadZipFile BadZipfileerror ZIP_STORED ZIP_DEFLATED ZIP_BZIP2ZIP_LZMA is_zipfileZipInfoZipFile PyZipFile LargeZipFilePathc@s eZdZdS)rN__name__ __module__ __qualname__rr#/usr/local/lib/python3.9/zipfile.pyr*src@s eZdZdS)r Nrrrrrr .sr i -.?s<4s4H2LHsPK z<4s4B4HL2L5H2LsPK z <4s2B4HL2L2HsPKz<4sLQLsPKz <4sQ2H2L4QsPKiPKr0structr/structEndArchive64LocatorstringEndArchive64LocatorrsizeEndCentDir64structEndArchive64stringEndArchive64_ECD_SIGNATURE_ECD_DISK_NUMBER_ECD_DISK_START_ECD_ENTRIES_THIS_DISK_ECD_ENTRIES_TOTAL _ECD_SIZE _ECD_OFFSET)fpinoffsetendrecdatasigZdisknoZreloffZdisksZszcreate_versionZ read_versionZdisk_numZdisk_dirZdircountZ dircount2ZdirsizeZ diroffsetrrr _EndRecData64s:       rYc Csf|dd|}z|t dWnty:YdS0|}t|tkr|ddtkr|dddkrtt |}t |}| d| |tt |t |St |dtd}||d|}|t}|dkrb|||t}t|tkrdSt tt |}|t}||t|t|}| || ||t |||||SdS)Nrrr sr-i)rDtellsizeEndCentDirr:r>r0stringEndArchiverFr/structEndArchivelistr1rYmaxrfind_ECD_COMMENT_SIZE) rSZfilesizerVrUZmaxCommentStartr5ZrecDataZ commentSizecommentrrrr9sD         r9c@sXeZdZdZdddZddZdd d Zd d Zd dZe dddddZ ddZ dS)r ) orig_filenamerB date_time compress_type_compresslevelrcr3 create_systemrXextract_versionreserved flag_bitsvolume internal_attr external_attr header_offsetCRC compress_size file_size _raw_timeNoNamerrrrrcCs||_|td}|dkr(|d|}tjdkrJtj|vrJ|tjd}||_||_|ddkrjtdt |_ d|_ d|_ d|_ tjdkrd|_nd|_t|_t|_d|_d|_d|_d|_d|_d|_d|_dS)Nr/rvz+ZIP does not support timestamps before 1980r-win32r)rdfindchrossepreplacerBre ValueErrorrrfrgrcr3sysplatformrhDEFAULT_VERSIONrXrirjrkrlrmrnrqrr)selfrBreZ null_byterrr__init__Ws4   zZipInfo.__init__cCsd|jj|jfg}|jtkr8|dt|j|j|jd?}|jd@}|rd|dt ||rv|d|| }|r|j r|d|j |r|j r|jtks|j |j kr|d|j |d d |S) Nz<%s filename=%r compress_type=%sr)rz filemode=%rz external_attr=%#xz file_size=%rz compress_size=%r>) __class__rrBrfrr1compressor_namesgetrnstatfilemodeis_dirrrrqr2)rrChiloisdirrrr__repr__s0       zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}|jd @rfd}}}n|j}|j}|j}|j}d} |dur|tkp|tk}|rd } |t| dt | d ||}|tks|tkr|st d d }d }t } |j t krtt| } n|j tkrtt| } t| |j|_t| |j|_|\} } ttt|j|j| |j |||||t| t| } | | |S)Nrrvr$rr!rrr&r rz|_|rd|_|jd O_n|j|_|S) Nrr"rvru;)rr;rrrwrr)) isinstancer{PathLikefspathrS_ISDIRst_modetime localtimest_mtimepathnormpath splitdriver|altseprnrrst_size) clsrBarcnamerstrmtimerezinforrr from_files0       zZipInfo.from_filecCs|jddkS)NrwrBrrrrrszZipInfo.is_dir)rtru)N)N) rrr __slots__rrrrr classmethodrrrrrrr =s + .%r cCs0tdD]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)range)crcr7rrr_gen_crcs   rcsldddtdur&ttttdatfddfdd|D] }|qLfd d }|S) NixV4igE#ixV4cs|d?||Ad@AS)Nrr)Zchr)crctablerrcrc323sz_ZipDecrypter..crc32cs<|d@d@ddd@d?dS)Nrrirr)c)rkey0key1key2rr update_keys7s z"_ZipDecrypter..update_keyscsNt}|j}|D]4}dB}|||dAd?d@N}|||qt|S)Nrrrr) bytearrayr1bytes)rVrCr1rk)rrrr decrypterAs z _ZipDecrypter..decrypter) _crctabler_maprr)pwdprr)rrrrrrr _ZipDecrypter)s   rc@s,eZdZddZddZddZddZd S) LZMACompressorcCs d|_dSN)_comprrrrrQszLZMACompressor.__init__cCsFtdtji}tjtjttj|gd|_tdddt ||S)Nidfilterszr[rnrVrrrr>s  z_SharedFile.readcCs$|jdur |j}d|_||dSr)r r )rfileobjrrrrs z_SharedFile.closeN)r)r)rrrrr[rDr>rrrrrrs  rc@s4eZdZddZddZddZddZd d Zd S) _TellablecCs||_d|_dSNr)r<rTrr<rrrrsz_Tellable.__init__cCs|j|}|j|7_|Sr)r<writerT)rrVrrrrrs z_Tellable.writecCs|jSr)rTrrrrr[sz_Tellable.tellcCs|jdSr)r<rrrrrrsz_Tellable.flushcCs|jdSr)r<rrrrrrsz_Tellable.closeN)rrrrrr[rrrrrrrs rcseZdZdZdZdZd'ddZdd Zd d Zd(d dZ d)ddZ ddZ d*ddZ ddZ ddZddZddZfddZd d!Zd+d#d$Zd%d&ZZS), ZipExtFilei@iiNFcCs&||_||_||_|j|_|j|_|j|_t |j|_ d|_ d|_ d|_ d|_||_|j|_t|drz|j|_td|_nd|_d|_z4|r||_|j|_|j|_|j|_d|_WntyYn0d|_|r"|j d@r|j!d?d@}n|jd?d@}|"}||kr"t#d |j$dS) NFr-rrpTrrrzBad password for file %r)%_fileobj_pwd_close_fileobjrf_compress_typerq_compress_leftrr_leftr _decompressor_eof _readbuffer_offsetnewlinesmoderBnamer@rp _expected_crcr _running_crc _seekablerr[_orig_compress_start_orig_compress_size_orig_file_size_orig_start_crcAttributeError _decrypterrkrs_init_decrypterrrd)rrr)zipinforZ close_fileobjZ check_bytehrrrrsF        zZipExtFile.__init__cCs4t|j|_|jd}|jd8_||dS)Nrr&)rrr3rr>r")rrrrrr4Hs  zZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|d|j|jf|jtkrb|dt |j|jn |d|dd |S)N<%s.%sz name=%r mode=%rr [closed]rr) rrrclosedr1r*r)r!rrrr2rrCrrrrSs   zZipExtFile.__repr__rcCsL|dkr>|jd|jd}|dkr>|j|j|}||_|Stj||S)Nr r)r&ryr'ioBufferedIOBasereadline)rlimitr6linerrrr>aszZipExtFile.readlinercCsr|t|j|jkr\||}t||jkrJ||j|jd|_d|_n|jt|8_|j|j|jdS)Nri)r0r&r'r>)rrchunkrrrpeekqs zZipExtFile.peekcCs|jrtddS)NI/O operation on closed file.T)r9r~rrrrreadable~szZipExtFile.readablecCs|jrtd|dus|dkrV|j|jd}d|_d|_|jsR|||j7}q:|S||j}|t|jkr|j|j|}||_|S|t|j}|j|jd}d|_d|_|dkr|js||}|t|kr||_||_||d|7}q||7}|t|8}q|S)Nzread from closed file.rr-)r9r~r&r'r%_read1MAX_Nr0)rrbufendrVrrrr>s8   zZipExtFile.readcCs@|jdurdSt||j|_|jr<|j|jkr     zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|krR|||t|7}n ||}|jtkrj|jdk|_nx|jtkrt ||j }|j ||}|jj p|jdko|jj |_|jr||j 7}n |j |}|jj p|jdk|_|d|j}|jt|8_|jdkrd|_|||S)Nrr-T)r%r!rr$unconsumed_tailr0_read2rr"r` MIN_READ_SIZErrrr#rJrrrrrEs4          zZipExtFile._read1cCsd|jdkrdSt||j}t||j}|j|}|jt|8_|sLt|jdur`||}|SrK) r"r`rOminrr>r0EOFErrorr3rrrrrNs      zZipExtFile._read2cs0z|jr|jWtn t0dSr)r rrsuperrrrrr s zZipExtFile.closecCs|jrtd|jSNrC)r9r~r-rrrrrszZipExtFile.seekablercCsL|jrtd|jstd|}|dkr4|}n.|dkrF||}n|dkrZ|j|}ntd||jkrr|j}|dkr~d}||}||j}|dkr|t|j kr||_d}nf|dkr|j |j |j |_|j|_|j|_d|_ d|_t|j|_d|_|}|jdur||dkrDt|j|}||||8}q|S) Nzseek on closed file.!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r9r~r-r<UnsupportedOperationr[r0r'r0r&rrDr.r1r,r/r"r#rr!r$r%r3r4rP MAX_SEEK_READr>)rrTrZcurr_posZnew_posZ read_offsetZ buff_offsetZread_lenrrrrDsL            zZipExtFile.seekcCs>|jrtd|jstd|j|jt|j|j }|S)Nztell on closed file.rU) r9r~r-r<rVr0r#r0r&r')rZfileposrrrr[Gs  zZipExtFile.tell)NF)r)r)r)r)rrrrFrOrWrr4rr>rBrDr>rJrLrErNrrrDr[ __classcell__rrrSrrs( 3    # %$  2rcs@eZdZddZeddZddZddZfd d ZZ S) _ZipWriteFilecCs8||_||_||_t|j|j|_d|_d|_d|_ dSr) _zinfo_zip64_zipfilerrfrg _compressor _file_size_compress_size_crc)rzfrrrrrrQsz_ZipWriteFile.__init__cCs|jjSr)r\r<rrrrr[sz_ZipWriteFile._fileobjcCsdS)NTrrrrrwritable_sz_ZipWriteFile.writablecCs|jrtdt|ttfr&t|}nt|}|j}|j|7_t ||j |_ |j rt|j |}|j t|7_ |j||SrT)r9r~rrrr0 memoryviewnbytesr^rr`r]rr_rr)rrVrdrrrrbs   z_ZipWriteFile.writec sj|jr dSzNt|jrR|j}|jt|7_|j||j|j _ n |j |j _ |j |j _ |j |j _|j jd@r|jrdnd}|jt|t|j j |j j |j j|j|j_nn|js|j tkrtd|jtkrtd|j|j_|j|j j|j|j |j|j|jj|jj|j |j |jj|j j<Wd|j_ n d|j_ 0dS)Nrzd d!d"d#Zd?d$d%Zd@d&d'ZdAd(d)Zed*d+Zd,d-Zd.d/ZdBd0d1ZdCd2d3Zd4d5Zd6d7Z d8d9Z!d:d;Z"dS)Dr NrTrc CsH|dvrtdt|||_d|_d|_i|_g|_||_||_||_ d|_ d|_ ||_ t |tjrpt|}t |trd|_||_dddd dd d d }||}zt|||_Wqty||vr||}YqYq0qqnd |_||_t|dd|_d |_t|_d|_d|_z|dkr2|n|dvrd|_z|j |_!Wn0t"tfyt#|j|_d|_!d|_Yn40z|j$|j!Wnt"tfyd|_Yn0nd|dkrz||j$|j!Wn4t%y|j$ddd|_|j |_!Yn0ntdWn$|j} d|_|&| Yn0dS)N)rjwxaz+ZipFile requires mode 'r', 'w', 'x', or 'a'Frr-r?w+bx+br+bwbxb)rjrkrlrmrprnrorr*Trj)rkrlrmrz"Mode must be 'r', 'w', 'x', or 'a')'r~r _allowZip64 _didModifydebugrhrgrrr)r_comment_strict_timestampsrr{rrstr _filePassedrBr<rAr<r:getattr _fileRefCnt threadingRLockr r-r _RealGetContentsr[rfr2rrDr_fpclose) rrr)r allowZip64rrZmodeDictrr<rrrrs             zZipFile.__init__cCs|Srrrrrr __enter__szZipFile.__enter__cCs |dSrr)rtypevalue tracebackrrr__exit__szZipFile.__exit__cCsd|jj|jjfg}|jdurd|jr8|d|jn|jdurR|d|j|d|jn |d|dd|S)Nr7z file=%rz filename=%rz mode=%rr8rr) rrrr<ryr1rBr)r2r:rrrrs    zZipFile.__repr__c Cs|j}z t|}Wnty,tdYn0|s:td|jdkrLt||t}|t}|t|_ |t ||}|t t kr|t t8}|jdkr||}td||||||_||jd||}t|}d}||kr|t} t| tkrtdtt| } | ttkr*td|jdkr>t| || t} | d} | d @rj| d } n | d } t| } || t| _|| t | _!| t"| _#| dd \ | _$| _%| _&| _'| _(| _)} }| _*| _+| _,| j&t-krt.d | j&d| dd\| _/| _0| _1| | _2|d?d|d?d@|d@| d?| d?d@| d@df| _3| 4| j#|| _#|j56| | |j7| j8<|t| t| t| t }|jdkrtd|qdS)NzFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!rrcp437rzzip file version %.1fr%r(r+r$rvrr&rtotal)9r<r9r:rruprintrQrR _ECD_COMMENTrv _ECD_LOCATIONrLrKrIrErfrDr>r<BytesIOsizeCentralDirr0rFr/structCentralDir _CD_SIGNATUREstringCentralDir_CD_FILENAME_LENGTHdecoder _CD_EXTRA_FIELD_LENGTHr3_CD_COMMENT_LENGTHrc_CD_LOCAL_HEADER_OFFSETrorXrhrirjrkrfrprqrrMAX_EXTRACT_VERSIONrrlrmrnrsrerrgr1rhrB)rr<rUZsize_cdZ offset_cdconcatZinferredrVrcentdirrBflagsrltdrrrr~-s                          zZipFile._RealGetContentscCsdd|jDS)NcSsg|] }|jqSrr).0rVrrr }r-z$ZipFile.namelist..rgrrrrnamelist{szZipFile.namelistcCs|jSrrrrrrinfolistszZipFile.infolistcCsLtdd|d|jD]0}d|jdd}td|j||jf|dqdS)Nz%-46s %19s %12s)z File Namez Modified ZSize)rz%d-%02d-%02d %02d:%02d:%02dr"z %-46s %s %12d)rrgrerBrr)rrrdaterrrprintdirs zZipFile.printdirc Cspd}|jD]`}z>||jd}||r,q Wdn1s@0YWq tyh|jYS0q dS)Nirj)rgrArBr>r)rZ chunk_sizerfrrrtestzips  $ zZipFile.testzipcCs$|j|}|dur td||S)Nz(There is no item named %r in the archive)rhrKeyError)rr*inforrrgetinfos  zZipFile.getinfocCs6|r t|ts tdt|j|r,||_nd|_dS)Npwd: expected bytes, got %s)rr TypeErrorrrr)rrrrr setpasswords zZipFile.setpasswordcCs|jSr)rvrrrrrcszZipFile.commentcCs^t|tstdt|jt|tkrNddl}|jdtdd|dt}||_ d|_ dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr stacklevelT) rrrrrr0ZIP_MAX_COMMENTwarningswarnrvrt)rrcrrrrrcs   cCs:||d|}|WdS1s,0YdSNrjrAr>)rr*rr<rrrr>sz ZipFile.readF force_zip64c s|dvrtd|r0t|ts0tdt|j|rD|dkrDtdjsRtdt|trb|}n,|dkrt|}j|_ j |_ n |}|dkrj ||dSjrtdjd 7_tj|jjjfd d }z|t}t|tkrtd tt|}|ttkr&td ||t}|trL||t|jd@r`t d|jd@rtt d|t!d@r|"d} n |"d} | |j#krtd|j#|f|jd @} | r|s҈j$}|st%d|nd}t&||||dWS|'Yn0dS)N>rkrjzopen() requires mode "r" or "w"rrkz'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedrrrcsjSr)r rrrrr-zZipFile.open..zTruncated file headerz Bad magic number for file header z$compressed patched data (flag bit 5)@zstrong encryption (flag bit 6)rrrz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionT)(r~rrrrrr<r rrfrrgr_open_to_writer r{rrorr r>sizeFileHeaderr0rrFr/r _FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHrkr_FH_GENERAL_PURPOSE_FLAG_BITSrrdrrrr) rr*r)rrrZzef_fileZfheaderfnameZ fname_strZ is_encryptedrrrrAsz              z ZipFile.opencCs|r|jstd|jr tdd|_d|_d|_|jtkrJ|jdO_|js^|jdO_|j sjd|_ |jo|p|j dt k}|jr|j |j|j |_||d|_|j ||d|_t|||S) NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rrrg?T)rsr~r rqrprkrfrr-rnrrrr<rDrfr[ro _writecheckrtrrrY)rrrrrrrr%s4    zZipFile._open_to_writecCs*|durt}n t|}||||Sr)r{getcwdr_extract_member)rmemberrrrrrextractNs  zZipFile.extractcCsH|dur|}|dur"t}n t|}|D]}||||q0dSr)rr{rrr)rrmembersrr5rrr extractall[s  zZipFile.extractallcCs^|j}|s(d}t|dt|}||_||}dd||D}|dd|D}|S)Nz:<>|"?*_css|]}|dVqdS).N)rstriprrlrrr vr-z1ZipFile._sanitize_windows_name..css|]}|r|VqdSrrrrrrrxr-)!_windows_illegal_name_trans_tablerx maketransr0 translatesplitr2)rrpathseptableZillegalrrr_sanitize_windows_namels zZipFile._sanitize_windows_namec sxt|ts||}|jdtjj}tjjrB|tjjtjj}tj |d}dtjj tjj ftjj fdd| tjjD}tjjdkr||tjj}tj ||}tj|}tj|}|rtj|st||r tj|st||S|j||dH}t|d}t||Wdn1sJ0YWdn1sj0Y|S) Nrwrrc3s|]}|vr|VqdSrrrZinvalid_path_partsrrrsz*ZipFile._extract_member..\rrq)rr rrBr}r{rr|rrcurdirpardirr2rrrdirnameexistsmakedirsrrmkdirrAshutil copyfileobj)rr targetpathrrZ upperdirssourcetargetrrrr{s2  &      LzZipFile._extract_membercCs|j|jvr(ddl}|jd|jdd|jdvr:td|jsHtdt|j|j sd}t |j t krpd}n|j tkrd }n|jtkrd }|rt|d dS) NrzDuplicate name: %rrrrkrlrmz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed Files countZFilesizez Zipfile size would require ZIP64 extensions)rBrhrrr)r~r<rrfrsr0rgZIP_FILECOUNT_LIMITrrrror )rrrrequires_zip64rrrrs,     zZipFile._writecheckc Cs|jstd|jrtdtj|||jd}|rDd|_d|_n0|durT||_ n|j |_ |durl||_ n|j |_ |r&|j |jr|j|j|j|_|j tkr|jdO_||d|_|j|||j|j<|j|d|j|_Wdn1s0Ynht|dL}||d }t||d Wdn1sd0YWdn1s0YdS) N7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsrrrTFr?rki ) r<r~r r rrwrrqrprfrrgrr r-rDrfr[rorrkrrtrgr1rhrBrrrArr)rrBrrfrrsrcdestrrrrsF      .z ZipFile.writec Cs"t|tr|d}t|tsxt|ttddd}|j|_|j|_ |j ddkrpd|_ |j dO_ q|d|_ n|}|j st d |jrt d |dur||_|dur||_ t||_|jH|j|d d }||Wdn1s0YWdn1s0YdS) Nrr")rBrerrwiAr)rrz?Can't write to ZIP archive while an open writing handle exists.rk)r))rrxrr rrrrfrrgrBrnr<r~r r0rrr rAr)rZzinfo_or_arcnamerVrfrrrrrrwritestrs:    zZipFile.writestrcCs |dSrrrrrr__del__szZipFile.__del__c Cs|jdurdS|jrtdzl|jdvrp|jrp|j,|jrJ|j|j| Wdn1sf0YW|j}d|_| |n|j}d|_| |0dS)NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r) r<r r~r)rtr r-rDrf_write_end_recordrrrrrrs  ( z ZipFile.closecCs|jD]}|j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}g}|jtksr|jtkr||j||jd }d }n |j}|j}|jtkr||jd }n|j}|j} d} |rt| d } t j d d t |ddt |g|R| } t } |j tkr&tt| } n|j tkrrArrrrrrrrrrrrrrrrrr sN ZN      b )  * 2 )^r c@s0eZdZdeddfddZd dd Zd d ZdS) r rjTrcCstj|||||d||_dS)N)r)rr)r r _optimize)rrr)rroptimizerrrrs zPyZipFile.__init__rNcCst|}|rD||sD|jr@tj|r,dnd}td||fdStj|\}}tj|rhtj|d}tj|r|rd||f}n|}|jrtd|d|| |dd |\}} |jrtd | | || t t |} | d| D]} tj|| } tj| \} }tj| rRtjtj| dr|j| ||d q|d kr|r~|| s~|jrtd | q| | dd |\}} |jrtd | | || qn|jrtd|t t |D]} tj|| } tj| \} }|d kr|r,|| s,|jrtd | q| | dd |\}} |jrVtd | | || qnP|d dd krtd| |dd |\}} |jrtd| | || dS)Nrrz%s %r skipped by filterfuncz __init__.py%s/%szAdding package inasrZAdding) filterfunc.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding file)r{rrurrrrr2isfile _get_codenamersortedlistdirremovesplitextwritepyr)rpathnamebasenamerZlabeldirr*ZinitnamerrdirlistrBrrootextrrrrs            zPyZipFile.writepyc sdfdd }|d}|d}tjj|dd}tjj|dd}tjj|d d}jdkr\tj|rt|jt|jkr|} } ntj|rt|jt|jkr|} |} ntj|rt|jt|jkr|} |} nvtj|rt|jt|jkr|} |} nD||rRt j j d kr4|} nt j j dkrH|} n|} |} n|} } njd krr|} |} n<|} jdkr|} n&jd kr|} nd j} t | tj| rt| jt|jks||jd s|} } tj| d} |rd || f} | | fS)Nrc sdddl}jrtd|z|j|d|dWn2|jy^}zt|jWYd}~dSd}~00dS)NrZ CompilingT)doraiserF) py_compilerurcompilePyCompileErrormsg)rrrerrrrr_compiles  z)PyZipFile._get_codename.._compilerz.pycr) optimizationrrrz"invalid value for 'optimize': {!r})rr)r) importlibutilcache_from_sourcerr{rrrrrrrformatr~r) rrrr Zfile_pyZfile_pycZ pycache_opt0Z pycache_opt1Z pycache_opt2rrrZ archivenamerrrrsj             zPyZipFile._get_codename)rN)rrrrrrrrrrrr s   Rr cCstt|ddSr) itertoolsislice _ancestry)rrrr_parentsCsrccs4|tj}|r0|tjkr0|Vt|\}}q dSr)r posixpathr|r)rtailrrrrVs rcCstt|j|Sr)r filterfalseset __contains__)ZminuendZ subtrahendrrr _differencepsrcsDeZdZeddZfddZddZddZed d Z Z S) CompleteDirscCs.tjtt|}dd|D}tt||S)Ncss|]}|tjVqdSr)rr|)rrrrrrr-z-CompleteDirs._implied_dirs..)rchain from_iterablerr_deduper)namesparentsZas_dirsrrr _implied_dirs~szCompleteDirs._implied_dirscs tt|}|t||Sr)rRrrr_r )rrrSrrrszCompleteDirs.namelistcCs t|Sr)rrrrrr _name_setszCompleteDirs._name_setcCs,|}|d}||vo||v}|r(|S|SNrw)r!)rr*rrZ dir_matchrrr resolve_dirszCompleteDirs.resolve_dircCsNt|tr|St|ts ||Sd|jvr.t}||}t|t||Sr)rrr r)__new__varsupdate)rrresrrrmakes    zCompleteDirs.make) rrr staticmethodr rr!r#rr(rXrrrSrrxs   rcs(eZdZfddZfddZZS) FastLookupcsFtt|jWdS1s&0Ytt||_|jSr) contextlibsuppressr2Z_FastLookup__namesrRr*rrrSrrrs $zFastLookup.namelistcsFtt|jWdS1s&0Ytt||_|jSr)r+r,r2Z_FastLookup__lookuprRr*r!rrSrrr!s $zFastLookup._name_set)rrrrr!rXrrrSrr*s r*c@seZdZdZd#ddZd$ddZedd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZeZed d!Zd"S)%rz>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})rcCst||_||_dSr)r*r(rat)rrr-rrrrs z Path.__init__rjcOs\|dd}|d}|jj|j||d}d|vrD|s8|r@td|Stj|g|Ri|S)Nrrrbz*encoding args invalid for binary operation)poprrAr-r~r< TextIOWrapper)rr)argskwargsrZzip_modestreamrrrrA s z Path.opencCst|jdSr")rrr-rrrrrr* sz Path.namecOsD|jdg|Ri|}|WdS1s60YdSrr)rr1r2strmrrr read_text szPath.read_textcCs6|d}|WdS1s(0YdS)Nr?r)rr4rrr read_bytes s zPath.read_bytescCst|jd|jdkSr")rrr-r)rrrrr _is_child szPath._is_childcCs t|j|Sr)rr)rr-rrr_next! sz Path._nextcCs|j p|jdSr")r-endswithrrrrr$ sz Path.is_dircCs | Sr)rrrrris_file' sz Path.is_filecCs|j|jvSr)r-rr!rrrrr* sz Path.existscCs.|stdt|j|j}t|j|S)NzCan't listdir a file)rr~rr8rrfilterr7)rZsubsrrriterdir- sz Path.iterdircCst|jj|jSr)rr2rrBr-rrrr__str__3 sz Path.__str__cCs|jj|dS)Nr) _Path__reprrrrrrr6 sz Path.__repr__cCs t|j|}||j|Sr)rr2r-r8rr#)raddnextrrrjoinpath9 sz Path.joinpathcCs(t|jd}|r|d7}||Sr")rrr-rr8)rZ parent_atrrrparent? sz Path.parentN)r)rj)rrrr>rrArir*r5r6r7r8rr:rr<r=rrA __truediv__rBrrrrrs&A   rc s ddl}d}|j|d}|jdd}|jdddd d |jd d d ddd|jdddddd|jddddd ||}|jdur|j}t|d}|}Wdn1s0Y|rtd |tdnB|j dur"|j }t|d}| Wdn1s0Yn|j durp|j \}}t|d}| |Wdn1sd0Yn|jdur|jd} |j} fddt| df}| D]P} tj| } | stjtj| } | dtjtjfvrd} || | qWdn1s0YdS) Nrz3A simple command-line interface for zipfile module.) descriptionT)requiredz-lz--list zShow listing of a zipfile)metavarhelpz-ez --extractr)rFz zExtract zipfile into target dir)nargsrGrHz-cz--create+)zzzCreate zipfile from sourcesz-tz--testzTest if a zipfile is validrjz.The following enclosed file is corrupted: {!r}z Done testingcsptj|r|||tnPtj|rl|r8|||tt|D]$}|tj||tj||qFdSr) r{rrrrrrrr2)rarzippathZnmaddToZiprrrMo s   zmain..addToZiprkr)argparseArgumentParseradd_mutually_exclusive_group add_argument parse_argstestr rrrr_rrrZcreater/r{rrrrr) r1rNrDparsergrouprraZbadfilerZzip_namefilesrrKrrLrmainG s\         &   *   ,    rW__main__)N)N)Zbinasciiimportlib.utilr r<rr{rrrrFrr|rr+rr ImportErrorrr__all__ Exceptionrr rrrrrrrrrrrrrrr^r]rr\rLrMrNrOrPrQrRrbrrrrrrZ_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ _CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZErrrZ_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESrrrrrZ_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMrZ_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZErrrGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRreStructr.r8r=r rYr9objectr rrrrrrrrrrrr=rrYr r rrdictfromkeysrrrr*rrWrrrrrsP                +=\& (KUu/2 =