B  p۷@sddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z yddl Z e j Z Wne k rdZ e j Z YnXy ddlZWne k rdZYnXy ddlZWne k rdZYnXdddddddd d d d d g ZGdddeZGdd d eZeZZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#e$e"Z%dZ&dZ'dZ(dZ)dZ*dZ+d Z,d!Z-dZ.d"Z/d#Z0d$Z1e$e0Z2dZ3dZ4dZ5dZ6dZ7dZ8d Z9d!Z:dZ;d"ZdZ?d'Z@dZAd(ZBd)ZCd*ZDd+ZEd,ZFd-ZGe$eFZHdZIdZJdZKdZLdZMdZNd ZOd!ZPdZQd"ZRd%ZSd&ZTd.ZUd/ZVe$eUZWd0ZXd1ZYe$eXZZdZ[dZ\dZ]dZ^dZ_dZ`d Zad!ZbdZcd"Zdd2Zeefd3Zgd4d5Zhd6d7Zid8d Zjd9d:Zkd;d<ZlGd=d d emZndaod>d?Zpd@dAZqGdBdCdCZrGdDdEdEZsdFdGdHdHdHdHdIdJdKdLdIdMdNdOdPdQdRdSZtdTdUZudgdVdWZvdXdYZwGdZd[d[ZxGd\d]d]ZyGd^d_d_ejzZ{Gd`dadaejzZ|Gdbd d Z}Gdcd d e}Z~dhdddeZedfkredS)iN BadZipFile BadZipfileerror ZIP_STORED ZIP_DEFLATED ZIP_BZIP2ZIP_LZMA is_zipfileZipInfoZipFile PyZipFile LargeZipFilec@s eZdZdS)rN)__name__ __module__ __qualname__rr*/opt/alt/python37/lib/python3.7/zipfile.pyr&sc@s eZdZdS)r N)rrrrrrrr *sii -.?s<4s4H2LHsPK z<4s4B4HL2L5H2LsPK z <4s2B4HL2L2HsPKz<4sLQLsPKz <4sQ2H2L4QsPKiPKz        r5c@sReZdZdZdddZddZdd d Zd d Zd dZe dddZ ddZ dS)r ) orig_filenamer= date_time compress_type_compresslevelr]r/ create_systemrRextract_versionreserved flag_bitsvolume internal_attr external_attr header_offsetCRC compress_size file_size _raw_timeNoNameirrrrrcCs||_|td}|dkr(|d|}tjdkrJtj|krJ|tjd}||_||_|ddkrjtdt |_ d|_ d|_ d|_ tjdkrd|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr/iz+ZIP does not support timestamps before 1980r)win32r)r^findchrossepreplacer=r_ ValueErrorrr`rar]r/sysplatformrbDEFAULT_VERSIONrRrcrdrerfrgrh)selfr=r_Z null_byterrr__init__Ss0   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=%rz compress_type=%sr&iz filemode=%rz external_attr=%#xz file_size=%rz compress_size=%r>) __class__rr=r`rr-compressor_namesgetrhstatfilemodeis_dirrlrkr.)r{r>hiloisdirrrr__repr__~s(         zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}|jd @rfd}}}n|j}|j}|j}|j}d} |dkr|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)Nrir!rrrrr#rrzy|jd|jfStk r8|jd|jdBfSXdS)Nasciizutf-8i)r=encodereUnicodeEncodeError)r{rrrrszZipInfo._encodeFilenameFlagscCs|j}tj}xxt|dkr|d|dd\}}|dt|krTtd||f|dkrt|dkrz|d|dd}nV|dkr|d |dd }n:|d kr|d |dd }n|dkrd}ntd||fd}|jdkrt||krtd|||_|d7}|jdkr:t||kr(td|||_|d7}|jdkrtt||kr\td|j}|||_|d7}||dd}qWdS)Nrz|_|rd|_|jdO_n|j|_|S)Nrrrrpir&) isinstancertPathLikefspathrS_ISDIRst_modetime localtimest_mtimepathnormpath splitdriverualtseprhrlst_size)clsr=arcnamestrmtimer_zinforrr from_files(       zZipInfo.from_filecCs|jddkS)Nrp)r=)r{rrrrszZipInfo.is_dir)rnro)N)N) rrr __slots__r|rrrr classmethodrrrrrrr 9s + .2 !cCs4x.tdD]"}|d@r$|d?dA}q |dL}q W|S)Nrrl q[)range)crcr3rrr_gen_crc&s  rcspdddtdkr&ttttdatfddfddx|D] }|qNWfd d }|S) NixV4igE#ixV4cs|d?||Ad@AS)Nrr)Zchr)crctablerrcrc32@sz_ZipDecrypter..crc32cs<|d@d@ddd@d?dS)Nrlirrr)c)rkey0key1key2rr update_keysDs z"_ZipDecrypter..update_keyscsRt}|j}x<|D]4}dB}|||dAd?d@N}|||qWt|S)Nrrrr) bytearrayr-bytes)rQr>r-rk)rrrr decrypterNs  z _ZipDecrypter..decrypter) _crctablerYmaprr)pwdprr)rrrrrrr _ZipDecrypter6s    rc@s,eZdZddZddZddZddZd S) LZMACompressorcCs d|_dS)N)_comp)r{rrrr|^szLZMACompressor.__init__cCsFtdtji}tjtjttj|gd|_tdddt ||S)Nid)filterszrrrrzs   zLZMADecompressor.decompressN)rrrr|rrrrrrssrstoreZshrinkreduceZimplodetokenizeZdeflateZ deflate64Zbzip2rZterseZlz77ZwavpackZppmd)rrrrrrrr rr!r"rrr(abcCsX|tkr nJ|tkr tsTtdn4|tkr6tsTtdn|tkrLtsTtdntddS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported) rrzlib RuntimeErrorrbz2rrNotImplementedError) compressionrrr_check_compressionsrcCsj|tkr2|dk r t|tjdSttjtjdS|tkrT|dk rLt|StS|tkrbt SdSdS)Ni) rrZ compressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrrZ BZ2Compressorrr)r` compresslevelrrr_get_compressors rcCsn|tkr dS|tkrtdS|tkr.tS|tkrrrrr]s   zZipExtFile.__repr__rcCsL|dkr>|jd|jd}|dkr>|j|j|}||_|Stj||S)Nr r)rrrrioBufferedIOBasereadline)r{limitr2linerrrrkszZipExtFile.readlinercCsr|t|j|jkr\||}t||jkrJ||j|jd|_d|_n|jt|8_|j|j|jdS)Nri)r,rrr9)r{rchunkrrrpeek{s zZipExtFile.peekcCsdS)NTr)r{rrrreadableszZipExtFile.readablecCs |dks|dkrL|j|jd}d|_d|_x|jsF|||j7}q.W|S||j}|t|jkr~|j|j|}||_|S|t|j}|j|jd}d|_d|_x^|dkr|js||}|t|kr||_||_||d|7}P||7}|t|8}qW|S)Nrr))rrr_read1MAX_Nr,)r{rbufendrQrrrr9s4   zZipExtFile.readcCs@|jdkrdSt||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)rrrrZunconsumed_tailr,_read2rrrZ MIN_READ_SIZErrrrr&)r{rrQrrrr!s2           zZipExtFile._read1cCsd|jdkrdSt||j}t||j}|j|}|jt|8_|sLt|jdk r`||}|S)Nrr)) rrZr)minrr9r,EOFErrorr)r{rrQrrrr(s      zZipExtFile._read2cs&z|jr|jWdtXdS)N)rrrsuper)r{)rrrrszZipExtFile.closecCs|jS)N)r )r{rrrrszZipExtFile.seekablercCsB|jstd|}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd||jkrd|j}|dkrpd}||}||j}|dkr|t|jkr||_d}nf|dkr |j |j |j |_ |j|_|j|_d|_d|_t|j|_d|_|}|jdk r |x.|dkr8t|j|}||||8}q W|S)Nz!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r)F)r rUnsupportedOperationrUrrwrr,rrr?rrr rrrrrrrrrr* MAX_SEEK_READr9)r{rOrZcurr_posZnew_posZ read_offsetZ buff_offsetZread_lenrrrr?sH           zZipExtFile.seekcCs0|jstd|j|jt|j|j}|S)Nz!underlying stream is not seekable)r rr-rrr,rr)r{ZfileposrrrrUIs zZipExtFile.tell)NF)r)r)r)r)rrrr"r)r.r|rrrrr r9r&r'r!r(rrr?rU __classcell__rr)rrrs& 2    ! %$  0rcs@eZdZddZeddZddZddZfd d ZZ S) _ZipWriteFilecCs8||_||_||_t|j|j|_d|_d|_d|_ dS)Nr) _zinfo_zip64_zipfilerr`ra _compressor _file_size_compress_size_crc)r{zfrrrrrr|Qs z_ZipWriteFile.__init__cCs|jjS)N)r3r7)r{rrrr[sz_ZipWriteFile._fileobjcCsdS)NTr)r{rrrwritable_sz_ZipWriteFile.writablecCsf|jrtdt|}|j|7_t||j|_|jrV|j|}|jt|7_|j ||S)NzI/O operation on closed file.) rrwr,r5rr7r4rr6rr)r{rQnbytesrrrrbs  z_ZipWriteFile.writec sb|jr dSzFt|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<Wdd|j_ XdS)Nrz          z_ZipWriteFile.close) rrrr|propertyrr9rrr/rr)rrr0Ps   r0c@seZdZdZdZdeddfddZddZdd Zd d Z d d Z ddZ ddZ d;ddZ ddZddZddZeddZejddZdd#d$Zd?d%d&Zd@d'd(Zed)d*Zd+d,Zd-d.ZdAd/d0ZdBd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)Cr NrTc CsL|dkrtdt|||_d|_d|_i|_g|_||_||_||_ d|_ d|_ t |t jrjt |}t |trd|_||_dddd dd d d }||}x^yt|||_Wn(tk r||kr||}wYnXPqWnd |_||_t|dd|_d |_t|_d|_d|_y|dkr0|n|dkrd|_y|j|_ Wn2t!tfk rt"|j|_d|_ d|_Yn6Xy|j#|j Wn t!tfk rd|_YnXnf|dkry||j#|j Wn6t$k r|j#ddd|_|j|_ YnXntdWn$|j}d|_|%|YnXdS)N)r@wxaz+ZipFile requires mode 'r', 'w', 'x', or 'a'Frr)r:zw+bzx+bzr+bwbZxb)r@rArBrCzr+bzw+bzx+brr Tr@)rArBrCrz"Mode must be 'r', 'w', 'x', or 'a')&rwr _allowZip64 _didModifydebugr>r=rrr r_commentrrtrrstr _filePassedr=rr<r7r6getattr _fileRefCnt threadingRLockrr r_RealGetContentsrUr<rrr?r_fpclose) r{rr r allowZip64rZmodeDictrr7rrrr|s             zZipFile.__init__cCs|S)Nr)r{rrr __enter__szZipFile.__enter__cCs |dS)N)r)r{typevalue tracebackrrr__exit__szZipFile.__exit__cCsd|jj|jjfg}|jdk rd|jr8|d|jn|jdk rR|d|j|d|jn |d|dd|S)Nz<%s.%sz file=%rz filename=%rz mode=%rz [closed]r}r~) rrrr7rJr-r=r r.)r{r>rrrrs    zZipFile.__repr__c Cs|j}y t|}Wntk r.tdYnX|sr=)r{r7rPZsize_cdZ offset_cdconcatZinferredrQrYcentdirr=flagsrBtdrrrrO%sp                4       zZipFile._RealGetContentscCsdd|jDS)NcSsg|] }|jqSr)r=).0rQrrr usz$ZipFile.namelist..)r=)r{rrrnamelistsszZipFile.namelistcCs|jS)N)r=)r{rrrinfolistwszZipFile.infolistcCsPtdd|dx:|jD]0}d|jdd}td|j||jf|dqWdS)Nz%-46s %19s %12s)z File Namez Modified ZSize)rz%d-%02d-%02d %02d:%02d:%02drz %-46s %s %12d)rZr=r_r=rl)r{rrZdaterrrprintdir|s  zZipFile.printdirc Cs^d}xT|jD]J}y.||jd}x||r0q$WWdQRXWq tk rT|jSXq WdS)Nir@)r=r<r=r9r)r{Z chunk_sizerfrrrtestzips  zZipFile.testzipcCs$|j|}|dkr td||S)Nz(There is no item named %r in the archive)r>rKeyError)r{r inforrrgetinfos   zZipFile.getinfocCs6|r t|ts tdt|j|r,||_nd|_dS)Nzpwd: expected bytes, got %s)rr TypeErrorrSrr)r{rrrr setpasswords zZipFile.setpasswordcCs|jS)N)rH)r{rrrr]szZipFile.commentcCs^t|tstdt|jt|tkrNddl}|jdtdd|dt}||_ d|_ dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr) stacklevelT) rrrwrSrr,ZIP_MAX_COMMENTwarningswarnrHrF)r{r]r{rrrr]s    c Cs"||d| }|SQRXdS)Nr@)r<r9)r{r rr7rrrr9sz ZipFile.readF) force_zip64c s|dkrtd|r0t|ts0tdt|j|rD|dkrDtdjsRtdt|trb|}n,|dkrt|}j|_ j |_ n |}|dkrj ||dSjrtdjd 7_tj|jjjfd d }y|t}t|tkrtd tt|}|ttkr&td ||t}|trL||t|jd@r`t d|jd@rtt d|jd@r|!d} n |!d} | |j"krtd|j"|f|jd @} | r|sЈj#}|st$d|nd}t%||||dS|&YnXdS)N>rAr@zopen() requires mode "r" or "w"zpwd: expected bytes, got %srAz'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closed)r}zyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.rcsjS)N)rr)r{rrr)zZipFile.open..zTruncated file headerz Bad magic number for file header z$compressed patched data (flag bit 5)@zstrong encryption (flag bit 6)izutf-8rWz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionT)'rwrrrwrSrr7r rr`rrarv_open_to_writerrLrrirPrr9sizeFileHeaderr,rrAr+r _FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHrerrcr^rrrr) r{r r rr}rZzef_fileZfheaderfnameZ fname_strZ is_encryptedr)r{rr<sp                z ZipFile.opencCs|r|jstd|jr tdt|ds0d|_d|_d|_d|_|jt krZ|jdO_|j sn|jdO_|j szd|_ |jo|p|jdt k}|j r|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.rlrrrig?T)rErwrr;rlrkrjrer`rr rhrr7r?r<rUri _writecheckrFrrr0)r{rr}rrrrrs4     zZipFile._open_to_writecCs*|dkrt}n t|}||||S)N)rtgetcwdr_extract_member)r{memberrrrrrextractHs  zZipFile.extractcCsL|dkr|}|dkr"t}n t|}x|D]}||||q2WdS)N)rortrrr)r{rmembersrrrrr extractallUs   zZipFile.extractallcCs^|j}|s(d}t|dt|}||_||}dd||D}|dd|D}|S)Nz:<>|"?*_css|]}|dVqdS).N)rstrip)rmrBrrr psz1ZipFile._sanitize_windows_name..css|]}|r|VqdS)Nr)rmrBrrrrrs)!_windows_illegal_name_trans_tablerI maketransr, translatesplitr.)rrpathseptableZillegalrrr_sanitize_windows_namefs zZipFile._sanitize_windows_namec sLt|ts||}|jdtjj}tjjrB|tjjtjj}tj |d}dtjj tjj ftjj fdd| tjjD}tjjdkr||tjj}tj ||}tj|}tj|}|rtj|st||r tj|st||S|j||d(}t|d}t||WdQRXWdQRX|S) Nrprr~c3s|]}|kr|VqdS)Nr)rmrB)invalid_path_partsrrrsz*ZipFile._extract_member..\)rrD)rr rvr=rvrtrrurrcurdirpardirr.rrrdirnameexistsmakedirsrrmkdirr<shutil copyfileobj)r{rZ targetpathrrZ upperdirssourcetargetr)rrrus.  &        zZipFile._extract_membercCs|j|jkr(ddl}|jd|jdd|jdkr:td|jsHtdt|j|j sd}t |j t krpd}n|j tkrd }n|jtkrd }|rt|d dS) NrzDuplicate name: %rr)ry)rArBrCz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closedz Files countZFilesizez Zipfile sizez would require ZIP64 extensions)r=r>r{r|r rwr7rr`rEr,r=ZIP_FILECOUNT_LIMITrlrrir )r{rr{requires_zip64rrrrs(     zZipFile._writecheckc CsJ|jstd|jrtdt||}|r>d|_d|_n0|dk rN||_n|j |_|dk rf||_ n|j |_ |r |j |j r|j|j|j|_|jtkr|jdO_||d|_|j|||j|j<|j|d|j|_WdQRXnCan't write to ZIP archive while an open writing handle existsrrTFr:rAi )r7rwrr rrrkrjr`rrarrr r?r<rUrirrerrFr=r-r>r=rrr<rr)r{r=rr`rrsrcdestrrrrs>       z ZipFile.writec Cst|tr|d}t|tsxt|ttddd}|j|_|j|_ |j ddkrpd|_ |j dO_ q|d|_ n|}|j st d |jrt d |dk r||_|dk r||_ t||_|j*|j|d d }||WdQRXWdQRXdS) Nzutf-8r)r=r_rrpiAr&iz7Attempt to write to ZIP archive that was already closedz?Can't write to ZIP archive while an open writing handle exists.rA)r )rrIrr rrrr`rrar=rhr7rwrr,rlrr<r)r{Zzinfo_or_arcnamerQr`rrrrrrwritestrs4    zZipFile.writestrcCs |dS)N)r)r{rrr__del__szZipFile.__del__c Cs||jdkrdS|jrtdzB|jdkr\|jr\|j"|jrJ|j|j| WdQRXWd|j}d|_| |XdS)NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.)rArBrC) r7rrwr rFrr r?r<_write_end_recordrP)r{r7rrrrs z ZipFile.closecCsrxP|jD]D}|j}|ddd>|dd>B|dB}|dd>|d d>B|ddB}g}|jtksv|jtkr||j||jd }d }n |j}|j}|jtkr||jd }n|j}|j} d} |rt| d } t j d d t |ddt |f|| } t } |j tkr(tt| } n|j tkr>tt| } t| |j} t| |j} yZ|\} }t tt| |j| |j||j |||j||t | t | t |jd|j|j|}Wnltk rttt| |j| |j|j |j |||j||t |j!t | t |jd|j|j|ft"j#dYnX|j$%||j$%| |j$%| |j$%|jq W|j$&}t |j}||j'}|j'}d}|t(krd}n|tkrd}n|tkrd}|r*|j)st*|dt t+t,ddddd|||| }|j$%|t t-t.d|d}|j$%|t/|d}t/|d }t/|d }t t0t1dd||||t |j2 }|j$%||j$%|j2|j$3dS)Nrir!rrrrr#rl)rz XN     b +  * 0 (fc@s0eZdZdeddfddZd dd Zd d ZdS) r r@TrcCstj|||||d||_dS)N)r rrQ)r r| _optimize)r{rr rrQoptimizerrrr|s zPyZipFile.__init__r~NcCst|}|rD||sD|jr@tj|r,dnd}td||fdStj|\}}tj|rptj|d}tj|r|rd||f}n|}|jrtd|d|| |dd |\}} |jrtd | | || t t |} | dx| D]} tj|| } tj| \} }tj| rTtjtj| dr|j| ||d q|d kr|r|| s|jrtd | q| | dd |\}} |jrtd | | || qWn|jrtd|xt t |D]} tj|| } tj| \} }|d kr|r2|| s2|jrtd | q| | dd |\}} |jr\td | | || qWnP|d dd krtd| |dd |\}} |jrtd| | || dS)Nrrz%s %r skipped by filterfuncz __init__.pyz%s/%szAdding package inasrZAdding) filterfuncz.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding file)rtrrGrrrZrr.isfile _get_codenamersortedlistdirremovesplitextwritepyr)r{pathnamebasenamerZlabeldirr ZinitnamerrZdirlistr=rrootZextrrrrsx                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 s`ddl}jrtd|y|j|d|dWn.|jk rZ}zt|jdSd}~XYnXdS)NrZ CompilingT)doraiserF) py_compilerGrZcompilePyCompileErrormsg)rrrerr)r{rr_compiles  z)PyZipFile._get_codename.._compilez.pyz.pycr~) optimizationrrrz"invalid value for 'optimize': {!r})rz%s/%s)r) importlibutilcache_from_sourcerrtrrrrrxrjrformatrwr) r{rrrZfile_pyZfile_pycZ pycache_opt0Z pycache_opt1Z pycache_opt2rrrZ archivenamer)r{rrs`             zPyZipFile._get_codename)r~N)rrrrr|rrrrrrr s Rc sddl}d}|j|d}|jdd}|jdddd d |jd d d ddd|jdddddd|jddddd ||}|jdk r|j}t|d}|}WdQRX|rtd |tdn|j dk r|j }t|d}| WdQRXn|j dk r.|j \}}t|d}| |WdQRXn|jdk r|jd} |j} fddt| d`}xX| D]P} tj| } | stjtj| } | dtjtjfkrd} || | qjWWdQRXdS) Nrz3A simple command-line interface for zipfile module.) descriptionT)requiredz-lz--listz zShow listing of a zipfile)metavarhelpz-ez --extractr)z z zExtract zipfile into target dir)nargsrrz-cz--create+)zzzCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr@z.The following enclosed file is corrupted: {!r}z Done testingcsttj|r|||tnTtj|rp|r8|||x6tt|D]$}|tj||tj||qHWdS)N) rtrrrrrrrr.)r8rzippathZnm)addToZiprrrls   zmain..addToZiprAr~)argparseArgumentParseradd_mutually_exclusive_group add_argument parse_argsZtestr rsrZrrYrqrrZcreatepoprtrrrrr) argsrrparsergrouprr8ZbadfilerZzip_namefilesrrr)rrmainDsT                    r__main__)N)N)rrtimportlib.utilrrxrrrrAZbinasciirMrr ImportErrorrr__all__ Exceptionrr rrrrrzrrrrrzrrrrgrXrWrrVrGrHrIrJrKrLrMr\r[r\r_rar^r`Z_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_SIZErbrdreZ_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESrfrrrrZ_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMZ_FH_GENERAL_PURPOSE_FLAG_BITSZ_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZErrrBrCr@rErFrDZ_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_CENTDIRr;Structr*r4r8r rSr5objectr rrrrrrrrrrrrrr0r r rrrrrrs<             +=m& &AN}/ <