MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: sonne (1011)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //opt/microsoft/omsconfig/Scripts/zipfile2.6.pyc
�
SRBac	@s�dZddlZddlZddlZddlZddlZddlZddlZddlZyddl	Z	e	j
Z
Wn ek
r�eZ	ej
Z
nXddddddd	d
dg	Z
defd��YZdefd
��YZeZdd>dZdd>Zdd>dZdZdZdZdZeje�ZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&eje%�Z'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3d Z4d!Z5d"Z6d#Z7dZ8d$Z9d%Z:d&Z;d'Z<eje;�Z=dZ>dZ?dZ@dZAdZBdZCdZDdZEdZFdZGdZHdZId(ZJd)ZKejeJ�ZLd*ZMd+ZNejeM�ZOdZPdZQdZRdZSdZTdZUdZVdZWdZXdZYd,�ZZd-�Z[d.�Z\de]fd/��YZ^d0fd1��YZ_d2fd3��YZ`d	fd4��YZad
eafd5��YZbed6�Zcedd7kr�ec�ndS(8s
Read and write ZIP files.
i����Nt
BadZipfileterrort
ZIP_STOREDtZIP_DEFLATEDt
is_zipfiletZipInfotZipFilet	PyZipFiletLargeZipFilecBseZRS((t__name__t
__module__(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRscBseZdZRS(su
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    (R	R
t__doc__(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRsiiiiis<4s4H2LHsPKiiiiiii	s<4s4B4HL2L5H2LsPKi
iii
iiiis<4s2B4HL2L2HsPKs<4sLQLsPKs
<4sQ2H2L4QsPKcCsKy3t|d�}t|�}|j�|r2tSWntk
rFnXtS(s?Quickly see if file is a ZIP file by checking the magic number.trb(topent_EndRecDatatclosetTruetIOErrortFalse(tfilenametfpintendrec((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�s

cCs)|j|td�|jt�}tjt|�\}}}}|tkrQ|S|dksi|dkrxtd��n|j|ttd�|jt�}tjt	|�\
}}}	}
}}}
}}}|t
kr�|S||t<||t<||t
<|
|t<||t<||t<||t<|S(sM
    Read the ZIP64 end-of-archive records and use that to update endrec
    iiis3zipfiles that span multiple disks are not supported(tseektsizeEndCentDir64LocatortreadtstructtunpacktstructEndArchive64LocatortstringEndArchive64LocatorRtsizeEndCentDir64tstructEndArchive64tstringEndArchive64t_ECD_SIGNATUREt_ECD_DISK_NUMBERt_ECD_DISK_STARTt_ECD_ENTRIES_THIS_DISKt_ECD_ENTRIES_TOTALt	_ECD_SIZEt_ECD_OFFSET(RtoffsetRtdatatsigtdisknotrelofftdiskstsztcreate_versiontread_versiontdisk_numtdisk_dirtdircountt	dircount2tdirsizet	diroffset((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt
_EndRecData64�s(0






cCs�|jdd�|j�}y|jtd�Wntk
rEd	SX|j�}|dd!tkr�|ddkr�tjt	|�}t
|�}|jd�|j|t�t|t|�St
|d
td�}|j|d�|j�}|jt�}|dkr�|||t!}t
tjt	|��}||t}|tt|�kr�|j|�|j||�t|||||�Snd	S(s�Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.iiii����ttiiNi(RttelltsizeEndCentDirRtNoneRtstringEndArchiveRRtstructEndArchivetlisttappendR6tmaxtrfindt_ECD_COMMENT_SIZEtlen(RtfilesizeR(RtmaxCommentStarttstarttrecDatatcomment((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�s6
#


cBsGeZdZdZddd�Zd�Zd�Zd�Zd�ZRS(s>Class with attributes describing each file in the ZIP archive.t
orig_filenameRt	date_timet
compress_typeRHtextrat
create_systemR.textract_versiontreservedt	flag_bitstvolumet
internal_attrt
external_attrt
header_offsettCRCt
compress_sizet	file_sizet	_raw_timetNoNamei�iicCs||_|jtd��}|dkr:|d|!}ntjdkrptj|krp|jtjd�}n||_||_t|_	d|_
d|_tj
dkr�d|_n	d|_d|_d|_d|_d|_d|_d|_d|_dS(Nit/R8twin32ii(RItfindtchrtostseptreplaceRRJRRKRHRLtsystplatformRMR.RNRORPRQRRRS(tselfRRJt	null_byte((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt__init__s*													cCs�|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rsd}}}n|j}|j}|j}|j}|tks�|tkrd}|tj|dtj	|�d	||�}d}d}t
d
|j�|_t
d
|j�|_n|j
�\}	}
tjtt|j|j|
|j|||||t|	�t|��
}||	|S(s'Return the per-file header as a string.ii�i	iiiiiiis<HHQQI����i-(RJRPRURVRWRLtZIP64_LIMITRtpacktcalcsizeR@RNR.t_encodeFilenameFlagststructFileHeadertstringFileHeaderRORKRC(RctdttdosdatetdostimeRURVRWRLtfmtRRPtheader((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt
FileHeader)s0	&&
				 cCstt|jt�r`y|jjd�|jfSWqptk
r\|jjd�|jdBfSXn|j|jfSdS(Ntasciisutf-8i(t
isinstanceRtunicodetencodeRPtUnicodeEncodeError(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRiKs
!cCs(|jd@r|jjd�S|jSdS(Nisutf-8(RPRtdecode(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_decodeFilenameTs
cCsw|j}tj}x^|rr|d|d �\}}|dkra|dkre|d|dd!�}no|dkr�|d|dd	!�}nJ|d
kr�|d|dd!�}n%|d
kr�d}ntd|f�d
}|jdkr|||_|d7}n|jdkr,|||_|d7}n|jdkra|j}|||_|d7}qan||d}qWdS(Ns<HHiiis<QQQiis<QQiis<QiisCorrupt extra field %sl����l��((l����l��(RLRRtRuntimeErrorRWRVRT(RcRLRttptlntcountstidxtold((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_decodeExtraZs4				



	
(s
orig_filenamesfilenames	date_times
compress_typescommentsextras
create_systemscreate_versionsextract_versionsreserveds	flag_bitssvolumes
internal_attrs
external_attrs
header_offsetsCRCs
compress_sizes	file_sizes	_raw_time(i�iiiii(	R	R
Rt	__slots__ReRqRiRxR(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�s2&	"			t
_ZipDecryptercBsDeZdZd�Ze�Zd�Zd�Zd�Zd�ZRS(sClass to handle decryption of files stored within a ZIP archive.

    ZIP supports a password-based form of encryption. Even though known
    plaintext attacks have been found against it, it is still useful
    to be able to get data out of such a file.

    Usage:
        zd = _ZipDecrypter(mypwd)
        plain_char = zd(cypher_char)
        plain_text = map(zd, cypher_text)
    cCs�d}dgd}xhtd�D]Z}|}xAtd�D]3}|d@r^|d?d@|A}q9|d?d@}q9W|||<q W|S(s�Generate a CRC-32 table.

        ZIP encryption uses the CRC32 one-byte primitive for scrambling some
        internal keys. We noticed that a direct implementation is faster than
        relying on binascii.crc32().
        I ���iiiii���(trange(tpolyttabletitcrctj((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_GenerateCRCTable�s

cCs%|d?d@|j|t|�Ad@AS(s(Compute the CRC32 primitive on one byte.ii���i�(tcrctabletord(RctchR�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_crc32�scCs=d|_d|_d|_x|D]}|j|�q"WdS(NixV4i�gE#i�xV4(tkey0tkey1tkey2t_UpdateKeys(Rctpwdtp((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRe�s
			
cCsx|j||j�|_|j|jd@d@|_|jddd@|_|jt|jd?d@�|j�|_dS(Ni�I����i�ii(R�R�R�R]R�(Rctc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR��scCsPt|�}|jdB}|||dAd?d@A}t|�}|j|�|S(sDecrypt a single character.iiii�(R�R�R]R�(RcR�tk((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt__call__�s

(	R	R
RR�R�R�ReR�R�(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�s					t
ZipExtFilecBskeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	dd�Z
dd	�Zdd
�ZRS(sZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    cCs�||_||_d|_d|_d|_d|_t|_t|_d|_	d|_
|j|_|j|_t|_
d|_|j|_d	|_|jtkr�tjd�|_ndS(
NlR8s
tri@ii�(s
i(tfileobjt	decryptert
bytes_readt	rawbuffert
readbuffert
linebufferRteoft
univ_newlinestnlSepstlastdiscardRKRVtclosedtmodeRtnametcompreadsizeRtzlibt
decompressobjtdc(RcR�tzipinfotdecrypt((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRe�s$													cCs+||_d|_|jr'd|_ndS(Ns
s
s
(s
(s
s
s
(R�R�(RcR�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytset_univ_newlines�s			cCs|S(N((Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt__iter__�scCs"|j�}|st��n|S(N(treadlinet
StopIteration(Rctnextline((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytnext�scCs
t|_dS(N(RR�(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�scCs�d\}}|jr�|j|jdfdkrD|jd|_nxH|jD]:}|jj|�}|dkrNt|�}||fSqNWn||fS(Ni����is
s
i(i����i����(s
s
(R�R�R�R\RC(RctnltnllenR_((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_checkfornewline�s	i����cCs?|dkrtj}n|dkr(dS|j�\}}|dkrXt||�}n�|t|j�8}xo|dkr�|dkr�|jt|d��}|s�Pn|j|7_|t|�8}|j�\}}qnW|dkr�|j}d|_|S|j| }|j|||!|_|j|||_|dS(sZRead a line with approx. size. If size is negative,
           read a whole line.
        iR8ids
(RatmaxintR�tminRCR�RR�(RctsizeR�R�tbufts((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR��s.		
cCs:g}x-tr5|j�}|s%Pn|j|�q	W|S(stReturn a list with all (following) lines. The sizehint parameter
        is ignored in this implementation.
        (RR�R?(Rctsizehinttresulttline((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt	readlines)s	cCs{|dkrdS|j|j}|jdk	r<|d8}n|dk	r�|dkr�|jtkr�t|j�}t|||�}q�|jt	kr�t|j�|kr�d}q�t|j
�}t||j|�}q�n||j|jkr	|j|j}n|dkr$|jj
|�}|jt|�7_|j
|7_
|j
r$|j
}d|_
|r�|jdk	r�djt|j|��}n|r|jt	kr|jj|�}|jj|_
|jrt|j
�dkr||jj�7}d|_qn|j|7_q$n|dksEt|j�|krZ|j}d|_n|j| }|j||_|S(NiR8i(RVR�R�R;RKRRCR�R�RR�R�R�RtjointmapR�t
decompresstunconsumed_tailR�tflush(RcR�tbytesToReadtlrtbytestnewdata((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR4sL
				!	
N(
R	R
RR;ReR�R�R�RR�R�R�R(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR��s					,cBs�eZdZdZdeed�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zdd�Zddd�Zddd
�Zdddd�Zd�Zd�Zddd�Zd�Zd�Zd�ZRS(sd Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=False)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read "r", write "w" or append "a".
    compression: ZIP_STORED (no compression) or ZIP_DEFLATED (requires zlib).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.

    R�cCs0|dkrtd��n|tkr*n*|tkrKtsTtd�qTn	td�||_t|_d|_i|_g|_	||_
|jdd	�d|_}d|_d	|_t|t�rXd|_||_id
d6dd6dd6}yt|||�|_Wqtk
rT|dkrNd}}t|||�|_qU�qXn'd
|_||_t|dd�|_|dkr�|j�n�|dkr�n�|dkry$|j�|jj|jd�Wq,tk
r�|jjdd�q,Xn+|js#|jj�d|_ntd�dS(s>Open the ZIP file with mode read "r", write "w" or append "a".R�twtas(ZipFile() requires mode "r", "w", or "a"s.Compression requires the (missing) zlib modules(That compression method is not supporteditbR8Rtwbsr+biR�isMode must be "r", "w" or "a"N(R�R�R�(RyRRR�t_allowZip64Rt
_didModifytdebugt
NameToInfotfilelisttcompressionR`R�R;R�RHRst
basestringt_filePassedRR
tfpRtgetattrt_GetContentst_RealGetContentsRt	start_dirRR(RctfileR�R�t
allowZip64tkeytmodeDict((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRe�s\											


		


	
cCsKy|j�Wn6tk
rF|js@|jj�d|_n�nXdS(sORead the directory, making sure we close the file if the format
        is bad.N(R�RR�R�RR;(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR��s
	
cCs|j}t|�}|s'td�n|jdkr>|GHn|t}|t}|t|_|t||}|t	t
kr�|tt8}n|jdkr�||}dG|G|G|GHn|||_
|j|j
d�|j|�}tj|�}d}x�||kr�|jt�}	|	dd!tkr@td�ntjt|	�}	|jdkri|	GHn|j|	t�}
t|
�}|j|	t�|_|j|	t�|_|	t|_|	dd!\|_|_|_ |_!|_"|_#}}
|_$|_%|_&|	d	d
!\|_'|_(|_)||_*|
d?d|
d
?d	@|
d@|d?|d
?d@|d@df|_+|j,�|j||_|j-�|_.|j/j0|�||j1|j.<|t|	t|	t|	t}|jdkrdG|GHqqWdS(s/Read in the table of contents for the ZIP file.sFile is not a zip fileiisgiven, inferred, offsetiis&Bad magic number for central directoryiiii	i�iiii?ttotalN(2R�RRR�R%R&t_ECD_COMMENTRHt
_ECD_LOCATIONR RRRR�RRt	cStringIOtStringIOtsizeCentralDirtstringCentralDirRRtstructCentralDirt_CD_FILENAME_LENGTHRt_CD_EXTRA_FIELD_LENGTHRLt_CD_COMMENT_LENGTHt_CD_LOCAL_HEADER_OFFSETRTR.RMRNRORPRKRURVRWRQRRRSRXRJRRxRR�R?R�(RcR�Rtsize_cdt	offset_cdtconcattinferredR(R�tcentdirRtxtttd((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR��sZ	





I	&
"cCs.g}x!|jD]}|j|j�qW|S(s+Return a list of file names in the archive.(R�R?R(RctlR(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytnamelistscCs|jS(sJReturn a list of class ZipInfo instances for files in the
        archive.(R�(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytinfolistscCsJdd	GHx:|jD]/}d|jd }d|j||jfGHqWdS(
s+Print a table of contents for the zip file.s%-46s %19s %12ss	File NamesModified    tSizes%d-%02d-%02d %02d:%02d:%02dis
%-46s %s %12dN(s	File NamesModified    R�(R�RJRRW(Rctzinfotdate((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytprintdirs	cCsed}xX|jD]M}y/|j|jd�}x|j|�rCq1WWqtk
r\|jSXqWdS(s%Read all the files and check the CRC.iiR�Ni(R�R
RRR(Rct
chunk_sizeR�tf((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyttestzip&s
cCs5|jj|�}|dkr1td|��n|S(s,Return the instance of ZipInfo given 'name'.s(There is no item named %r in the archiveN(R�tgetR;tKeyError(RcR�tinfo((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytgetinfo3s
cCs
||_dS(s)Set default password for encrypted files.N(R�(RcR�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytsetpassword<scCs|j|d|�j�S(s)Return file bytes (as a string) for name.R�(R
R(RcR�R�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR@scCsF|dkrtd�n|js-td�n|jrB|j}nt|jd�}t|t�rl|}n|j|�}|j|j	d�|j
t�}|dd!tkr�t
d	�ntjt|�}|j
|t�}|tr�|j
|t�n||jkr't
d
|j|f�n|jd@}d}	|r�|sR|j}n|shtd|�nt|�}	|j
d
�}
t|	|
dd
!�}|jd@r�|jd?d@}n|jd?d@}t|d�|kr�td|��q�n|	dkrt||�}
nt|||	�}
d|krB|
jt�n|
S(s#Return file-like object for 'name'.R�tUtrUs&open() requires mode "r", "U", or "rU"s3Attempt to read ZIP archive that was already closedRiis Bad magic number for file headers3File name in directory "%s" and header "%s" differ.is6File %s is encrypted, password required for extractioniii�iisBad password for file(R�R�srUN(RyR�R�R
RRsRR�RRTRtsizeFileHeaderRkRRRRjt_FH_FILENAME_LENGTHt_FH_EXTRA_FIELD_LENGTHRIRPR;R�R�R�RXRUR�R�R�R(RcR�R�R�tzef_fileR�tfheadertfnametis_encryptedtzdR�tht
check_bytetzef((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR
DsZ				



cCsOt|t�s!|j|�}n|dkr<tj�}n|j|||�S(s#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        N(RsRR�R;R^tgetcwdt_extract_member(RctmembertpathR�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytextract�s
cCsC|dkr|j�}nx!|D]}|j|||�q"WdS(s�Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N(R;R�R(RcRtmembersR�R�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt
extractall�s
cCsm|dtjjtjjfkrQttjj|�d�dkrQ|d }n|jddkr�tjj||jd�}ntjj||j�}tjj|�}tjj	|�}|r�tjj
|�r�tj|�n|jddkr!tjj|�stj
|�n|S|j|d|�}t|d�}tj||�|j�|j�|S(sbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        i����iiRZR�R�(R^RR_taltsepRCt
splitdriveRR�tnormpathtdirnametexiststmakedirstisdirtmkdirR
R�tshutiltcopyfileobjR(RcR
t
targetpathR�t	upperdirstsourcettarget((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�s(""


cCs�|j|jkr-|jr-dG|jGHq-n|jdkrHtd�n|js]td�n|jtkrtrtd�n|jt	tfkr�td�n|j
tkr�|js�t
d��q�n|jtkr�|js�t
d	��q�nd
S(s6Check for errors before writing a file to the archive.sDuplicate name:R�R�s write() requires mode "w" or "a"s4Attempt to write ZIP archive that was already closeds.Compression requires the (missing) zlib modules(That compression method is not supporteds'Filesize would require ZIP64 extensionss+Zipfile size would require ZIP64 extensionsN(R�R�(RR�R�R�RyR�RKRR�RRWRfR�RRT(RcR�((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt_writecheck�s(							cCs�|jstd��ntj|�}tj|j�}tj|j�}|dd!}|dkrm|}ntj
jtj
j|�d�}x*|dtj
tjfkr�|d}q�W|r�|d7}nt||�}|dd@d>|_|dkr|j|_n	||_|j|_d|_|jj�|_|j|�t|_|r�d|_d|_d|_|jj|�||j|j <|jj!|j"��dSt#|d	�}	d|_}
d|_}d|_}|jj!|j"��|jt$kr(t%j&t%j't%j(d
�}
nd}
xw|	j)d�}|sJPn|t*|�}t+||
�d
@}
|
r�|
j,|�}|t*|�}n|jj!|�q1|	j-�|
r�|
j.�}|t*|�}|jj!|�||_n	||_|
|_||_|jj�}|jj/|jdd�|jj!t0j1d|j|j|j��|jj/|d�|jj|�||j|j <dS(sLPut the bytes from filename into the archive under the name
        arcname.s7Attempt to write to ZIP archive that was already closediiiRZi��lNRi�iiI����is<LLLi (2R�RyR^tstattS_ISDIRtst_modettimet	localtimetst_mtimeR;RRRR_RRRSR�RKtst_sizeRWRPR9RTR RR�RVRUR�R?R�RtwriteRqR
RR�tcompressobjtZ_DEFAULT_COMPRESSIONtDEFLATEDRRCtcrc32tcompressRR�RRRg(RcRtarcnameRKtstRtmtimeRJR�R�RURVRWtcmprR�tposition((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR(�s�	
	"
		
				



			
cCs�t|t�sOtd|dtjtj��d �}|j|_d|_n|}|jsmtd��nt	|�|_
|jj�|_|j
|�t|_t|�d@|_|jtkrtjtjtjd�}|j|�|j�}t	|�|_n|j
|_|jj�|_|jj|j��|jj|�|jj�|jd	@r�|jjtjd
|j|j|j
��n|jj |�||j!|j"<dS(
s�Write a file into the archive.  The contents is the string
        'bytes'.  'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.RRJii�is7Attempt to write to ZIP archive that was already closedI����i�is<LLLNi�(#RsRR$R%R�RKRSR�RyRCRWR9RTR RR�R,RURR�R)R*R+R-R�RVR(RqRPRRgR�R?R�R(Rctzinfo_or_arcnameR�R�tco((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytwritestr:s:	
	

cCs|j�dS(s2Call the "close()" method in case the user forgot.N(R(Rc((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt__del__ascCs�|jdkrdS|jdkr�|jr�d}|jj�}x�|jD]�}|d}|j}|ddd>|dd>B|d	B}|d
d>|dd>B|dd	B}g}|jtks�|j	tkr|j
|j�|j
|j	�d
}d
}	n|j}|j	}	|jtkr<|j
|j�d}
n	|j}
|j}|r�t
jddt|�ddt|�|�|}td|j�}td|j�}
n|j}|j}
y�|j�\}}t
jtt|
|j||j||j|||j|	|t|�t|�t|j�d|j|j|
�}Wn�tk
r�tjtt|
|j||j|j |j|||j|	|t|j!�t|�t|j�d|j|j|
fIJ�nX|jj"|�|jj"|�|jj"|�|jj"|j�qJW|jj�}|}||}|}|t#ksc|tksc|tkr�t
jt$t%ddddd||||�}|jj"|�t
jt&t'd|d�}|jj"|�t(|d�}t(|d
�}t(|d
�}nt|j�t)kr?|j*dkr,dt)}n|jt) |_nt
jt+t,dd||||t|j��	}|jj"|�|jj"|j�|jj-�n|j.s�|jj/�nd|_dS(sJClose the file, and for mode "w" and "a" write the ending
        records.NR�R�iii�i	iiiiiI����l��s<HHtQii-i,i��s3Archive comment is too long; truncating to %d bytes(R�R�(0R�R;R�R�R9R�RJRWRfRVR?RTRLRRgRCR@RNR.RiR�R�RMRORKRURHRRRStDeprecationWarningRatstderrRPRR(tZIP_FILECOUNT_LIMITRRRRR�tZIP_MAX_COMMENTR�R=R<R�R�R(Rctcounttpos1R�RlRmRnRLRWRVRTt
extra_dataRNR.RRPR�tpos2tcentDirCounttcentDirSizet
centDirOffsettzip64endrectzip64locrectmsgR((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRes�
	&&									


!	

	N(R	R
RR;R�RRReR�R�R�R�R�R�R�R�RR
RRRR R(R5R6R(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR|s*
;		@				
			N	%	R	'	cBs#eZdZdd�Zd�ZRS(sDClass to create ZIP archives with Python library files and packages.R8c
Cs�tjj|�\}}tjj|�r|tjj|d�}tjj|�r�|rjd||f}n|}|jr�dG|GdG|GHn|j|dd!|�\}}|jr�dG|GHn|j||�tj	|�}|j
d�x�|D]�}	tjj||	�}
tjj|	�\}}tjj|
�rptjjtjj|
d��r�|j|
|�q�q�|dkr�|j|
dd!|�\}}|jr�dG|GHn|j||�q�q�Wq�|jr�d	G|GHnx�tj	|�D]�}	tjj||	�}
tjj|	�\}}|dkr�|j|
dd!|�\}}|jrbdG|GHn|j||�q�q�Wn`|ddkr�t
d
�n|j|dd!|�\}}|jr�dG|GHn|j||�dS(
s,Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyo or module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        s__init__.pys%s/%ssAdding package intasii����tAddings.pysAdding files from directorys.Files added with writepy() must end with ".py"sAdding fileN(R^RtsplitRR�tisfileR�t
_get_codenameR(tlistdirtremovetsplitexttwritepyRy(
RctpathnametbasenametdirR�tinitnameRR.tdirlistRRtroottext((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRN�sZ		

!					c
Cs8|d}|d}|d}tjj|�r]tj|�jtj|�jkr]|}n�tjj|�s�tj|�jtj|�jkr�ddl}|jr�dG|GHny|j||dt	�Wn|j
k
r�}|jGHnX|}n|}tjj|�d}	|r.d||	f}	n||	fS(	sReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        s.pys.pycs.pyoi����Nt	Compilingis%s/%s(
R^RRIR!R&t
py_compileR�tcompileR;RtPyCompileErrorRERH(
RcRORPtfile_pytfile_pyctfile_pyoRRWterrtarchivename((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRJs*


$	$		(R	R
RRNRJ(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyR�sAc
s�ddl}|jd�}|dkr7tjd}n|sN|ddkrc|GHtjd�n|ddkr�t|�d	kr�|GHtjd�nt|dd
�}|j�|j	�n|ddkr t|�d	kr�|GHtjd�nt|dd
�}|j
�dGHn�|ddkr;t|�dkrW|GHtjd�nt|dd
�}|d	}x�|j�D]�}|jd
�r�t
jj||d	�}nt
jj||�}t
jj|�}t
jj|�s�t
j|�nt|d�}|j|j|��|j	�q�W|j	�n�|ddkr�t|�dkrr|GHtjd�n�fd��t|dddt�}x.|d	D]"}	�||	t
jj|	��q�W|j	�ndS(Ni����sE        Usage:
            zipfile.py -l zipfile.zip        # Show listing of a zipfile
            zipfile.py -t zipfile.zip        # Test if a zipfile is valid
            zipfile.py -e zipfile.zip target # Extract zipfile into target dir
            zipfile.py -c zipfile.zip src ... # Create zipfile from sources
        iis-ls-cs-es-tiR�sDone testingis./R�cs�tjj|�r(|j||t�n]tjj|�r�xHtj|�D]4}�|tjj||�tjj||��qJWndS(N(R^RRIR(RRRKR�(tzfRtzippathtnm(taddToZip(s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyRbqsR�R�(s-ls-cs-es-t(ttextwraptdedentR;RatargvtexitRCRR�RR�R�t
startswithR^RR�RRRR
R(RRRP(
targsRctUSAGER_toutRttgtttgtdirR�tsrc((Rbs./opt/microsoft/omsconfig/Scripts/zipfile2.6.pytmain7s`	




	 t__main__(eRRR^R$RaRtbinasciiR�R!R�R,tImportErrorR;t__all__t	ExceptionRRRRfR:R;RRR=R<RhR:R R!R"R#R$R%R&RBR�R�R�R�R�t
_CD_SIGNATUREt_CD_CREATE_VERSIONt_CD_CREATE_SYSTEMt_CD_EXTRACT_VERSIONt_CD_EXTRACT_SYSTEMt
_CD_FLAG_BITSt_CD_COMPRESS_TYPEt_CD_TIMEt_CD_DATEt_CD_CRCt_CD_COMPRESSED_SIZEt_CD_UNCOMPRESSED_SIZER�R�R�t_CD_DISK_NUMBER_STARTt_CD_INTERNAL_FILE_ATTRIBUTESt_CD_EXTERNAL_FILE_ATTRIBUTESR�RjRkRt
_FH_SIGNATUREt_FH_EXTRACT_VERSIONt_FH_EXTRACT_SYSTEMt_FH_GENERAL_PURPOSE_FLAG_BITSt_FH_COMPRESSION_METHODt_FH_LAST_MOD_TIMEt_FH_LAST_MOD_DATEt_FH_CRCt_FH_COMPRESSED_SIZEt_FH_UNCOMPRESSED_SIZERRRRRRRRt_CD64_SIGNATUREt_CD64_DIRECTORY_RECSIZEt_CD64_CREATE_VERSIONt_CD64_EXTRACT_VERSIONt_CD64_DISK_NUMBERt_CD64_DISK_NUMBER_STARTt_CD64_NUMBER_ENTRIES_THIS_DISKt_CD64_NUMBER_ENTRIES_TOTALt_CD64_DIRECTORY_SIZEt_CD64_OFFSET_START_CENTDIRRR6RtobjectRR�R�RRRnR	(((s./opt/microsoft/omsconfig/Scripts/zipfile2.6.pyt<module>s�<$



		!	:�;���ZcI