MINI MINI MANI MO

Path : /lib64/python3.6/__pycache__/
File Upload :
Current File : //lib64/python3.6/__pycache__/gzip.cpython-36.opt-2.pyc

3


 \nO@sddlZddlZddlZddlZddlZddlZddlZddlZddddgZd\Z	Z
ZZZ
d\ZZdd
dZddZGdddZGdddejZGdddejZdddZddZddZedkredS)NGzipFileopencompress
decompressrb	cCsd|kr d|krPtd|fn0|dk	r0td|dk	r@td|dk	rPtd|jdd}t|tttjfr|t|||}n,t|dst|d	rtd|||}nt	d
d|krt
j||||S|SdS)NtbzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary modereadwritez1filename must be a str or bytes object, or a file)
ValueErrorreplace
isinstancestrbytesosPathLikerhasattr	TypeErrorio
TextIOWrapper)filenamemode
compresslevelencodingerrorsnewlineZgz_modeZbinary_filer#/usr/lib64/python3.6/gzip.pyrs$cCs|jtjd|dS)Nz<L)rstructZpack)outputvaluer#r#r$write32u@sr(c@s8eZdZd
ddZddZdddZdd	Zd
dZdS)_PaddedFilecCs ||_t||_||_d|_dS)Nr)_bufferlen_lengthfile_read)selffprependr#r#r$__init__Js
z_PaddedFile.__init__cCs~|jdkr|jj|S|j||jkrJ|j}|j|7_|j||jS|j}d|_|j|d|jj||j|SdS)N)r/r.rr-r+)r0sizerr#r#r$rPs
z_PaddedFile.readcCs>|jdkr||_n|jt|8_dSt|j|_d|_dS)Nr)r/r+r,r-)r0r2r#r#r$r2]s
z_PaddedFile.prependcCsd|_d|_|jj|S)N)r/r+r.seek)r0Zoffr#r#r$r5fsz_PaddedFile.seekcCsdS)NTr#)r0r#r#r$seekableksz_PaddedFile.seekableN)r*)r*)__name__
__module____qualname__r3rr2r5r6r#r#r#r$r)Es


	r)c@seZdZdZd,ddZeddZeddZd	d
ZddZ	d
dZ
ddZd.ddZd0ddZ
ddZeddZddZejfddZddZd d!Zd"d#Zd$d%Zd&d'Zejfd(d)Zd2d*d+ZdS)3rNrcCs2|r"d|ksd|kr"tdj||r6d|kr6|d7}|dkrTtj||pJd}|_|dkr|t|dd}t|ttfsd}n
t	j
|}|dkrt|dd}|jd	rt|_
t|}tj||_||_nN|jdrt|_
|j|tj|tjtjtjd
|_||_ntdj|||_|j
tkr.|jdS)Nr
UzInvalid mode: {!r}rrnamerrrwaxr)r=r>r?)rformatbuiltinsr	myfileobjgetattrrrrrfspath
startswithREADr_GzipReaderrBufferedReaderr+r;WRITE_init_writezlibZcompressobjZDEFLATED	MAX_WBITSZ
DEF_MEM_LEVELr_write_mtimefileobj_write_gzip_header)r0rrrrNmtimerawr#r#r$r3{s>#


zGzipFile.__init__cCsBddl}|jdtd|jtkr<|jdddkr<|jdS|jS)Nrzuse the name attributerz.gz)warningswarnDeprecationWarningrrIr;)r0rTr#r#r$rs

zGzipFile.filenamecCs
|jjjS)N)r+rQ_last_mtime)r0r#r#r$rPszGzipFile.mtimecCs.t|j}d|dddtt|dS)Nz<gzip r >)reprrNhexid)r0sr#r#r$__repr__s
zGzipFile.__repr__cCs.||_tjd|_d|_g|_d|_d|_dS)Nr*r)r;rKcrc32crcr4Zwritebufbufsizeoffset)r0rr#r#r$rJszGzipFile._init_writecCs|jjd|jjdy<tjj|j}t|ts<|jd}|j	drR|dd}Wnt
k
rld}YnXd}|rzt}|jjt|jd|j
}|dkrtj}t|jt||jjd|jjd	|r|jj|d
dS)Nszlatin-1s.gzrRr*rrS)rNrrpathbasenamer;rrencodeendswithUnicodeEncodeErrorFNAMEchrrMtimer(int)r0ZfnameflagsrPr#r#r$rOs,



zGzipFile._write_gzip_headercCs|j|jtkr&ddl}t|jd|jdkr8tdt|t	rLt
|}nt|}|j}|dkr|jj
|jj||j|7_tj||j|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)_check_not_closedrrIerrnoOSErrorEBADFrNrrrr,
memoryviewnbytesrrr4rKr`rarc)r0datarsZlengthr#r#r$rs 



zGzipFile.writercCs2|j|jtkr&ddl}t|jd|jj|S)Nrz$read() on write-only GzipFile object)rrrrFrsrtrur+r)r0r4rsr#r#r$rs

z
GzipFile.readcCs@|j|jtkr&ddl}t|jd|dkr4tj}|jj	|S)Nrz%read1() on write-only GzipFile object)
rrrrFrsrtrurDEFAULT_BUFFER_SIZEr+read1)r0r4rsr#r#r$rzs
zGzipFile.read1cCs2|j|jtkr&ddl}t|jd|jj|S)Nrz$peek() on write-only GzipFile object)rrrrFrsrtrur+peek)r0nrsr#r#r$r{#s

z
GzipFile.peekcCs
|jdkS)N)rN)r0r#r#r$closed*szGzipFile.closedcCs|j}|dkrdSd|_zP|jtkrR|j|jjt||jt||jd@n|jt	krf|j
jWd|j}|rd|_|jXdS)Nl)
rNrrIrrflushr(rar4rFr+closerB)r0rNrBr#r#r$r.s

zGzipFile.closecCs4|j|jtkr0|jj|jj||jjdS)N)rrrrIrNrrr~)r0Z	zlib_moder#r#r$r~As
zGzipFile.flushcCs
|jjS)N)rNfileno)r0r#r#r$rHszGzipFile.filenocCs"|jtkrtd|jjddS)NzCan't rewind in write moder)rrFrtr+r5)r0r#r#r$rewindPs
zGzipFile.rewindcCs
|jtkS)N)rrF)r0r#r#r$readableWszGzipFile.readablecCs
|jtkS)N)rrI)r0r#r#r$writableZszGzipFile.writablecCsdS)NTr#)r0r#r#r$r6]szGzipFile.seekablecCs|jtkr|tjkr2|tjkr*|j|}ntd||jkrDtd||j}dd}xt|dD]}|j	|qdW|j	d|dn |jt
kr|j|jj
||S|jS)NzSeek from end not supportedzNegative seek in write modergi)rrIrSEEK_SETSEEK_CURrcrrtrangerrFrrr+r5)r0rcwhencecountchunkir#r#r$r5`s 





z
GzipFile.seekcCs|j|jj|S)N)rrr+readline)r0r4r#r#r$rtszGzipFile.readline)NNrNNrZ)rZrZ)rZrZ)rZ)r7r8r9rBr3propertyrrPr_rJrOrrrzr{r}rrKZZ_SYNC_FLUSHr~rrrrr6rrr5rr#r#r#r$rns,
H


csZeZdZfddZddZddZddZdd
dZdd
ZddZ	fddZ
ZS)rGcs,tjt|tjtjdd|_d|_dS)N)ZwbitsT)superr3r)rKZ
decompressobjrL_new_memberrW)r0fp)	__class__r#r$r3zsz_GzipReader.__init__cCstjd|_d|_dS)Nr*r)rKr`_crc_stream_size)r0r#r#r$
_init_readsz_GzipReader._init_readcCsJ|jj|}x8t||krD|jj|t|}|s:td||7}qW|S)NzACompressed file ended before the end-of-stream marker was reached)_fprr,EOFError)r0r|rxrr#r#r$_read_exactsz_GzipReader._read_exactcCs|jjd}|dkrdS|dkr,td|tjd|jd\}}|_|dkrVtd|t@r|tjd	|jd\}|j||t@rx |jjd
}|s|dkrPqW|t	@rx |jjd
}|s|dkrPqW|t
@r|jddS)
Nrr*FszNot a gzipped file (%r)z<BBIxxr	zUnknown compression methodz<HrrgT)rrrtr%unpackrrWFEXTRArmFCOMMENTFHCRC)r0magicmethodflagZ	extra_lenr^r#r#r$_read_gzip_headers0

z_GzipReader._read_gzip_headerrcCs|dkr|jS|sdSx|jjr@|jd|_|jf|j|_|jrh|j|jsb|j	|_
dSd|_|jjt
j}|jj||}|jjdkr|jj|jjn|jjdkr|jj|jj|dkrP|dkrtdqW|j||j	t|7_	|S)Nrr*TFzACompressed file ended before the end-of-stream marker was reached)readallZ
_decompressoreof	_read_eofrZ_decomp_factoryZ_decomp_argsrrZ_posZ_sizerrrryrZunconsumed_tailr2Zunused_datar_add_read_datar,)r0r4bufZ
uncompressr#r#r$rs:

z_GzipReader.readcCs$tj||j|_|jt||_dS)N)rKr`rrr,)r0rxr#r#r$rsz_GzipReader._add_read_datacCstjd|jd\}}||jkr<tdt|t|jfn||jd@krRtdd}x|dkrn|jjd}qXW|r|jj	|dS)Nz<IIr	zCRC check failed %s != %slz!Incorrect length of data producedrgr)
r%rrrrtr\rrrr2)r0r`Zisizecr#r#r$rs


z_GzipReader._read_eofcstjd|_dS)NT)r_rewindr)r0)rr#r$rs
z_GzipReader._rewindrZ)rZ)r7r8r9r3rrrrrrr
__classcell__r#r#)rr$rGys!
3rGc	Cs4tj}t|d|d}|j|WdQRX|jS)Nwb)rNrr)rBytesIOrrgetvalue)rxrrr1r#r#r$rsc	Cs$ttj|d
}|jSQRXdS)N)rN)rrrr)rxr1r#r#r$rscCs>tjdd}|o|ddk}|r.|dd}|s8dg}x|D]}|r|dkrltddtjjd}tjj}q|d
dd	krtd
t|q@t|d}t	j|ddd}n>|dkrtjj}tddtjjd}nt	j|d}t|d	d}x |j
d}|sP|j|qW|tjjk	r"|j|tjjk	r@|jq@WdS)Nrrz-d-rr)rrrNrRz.gzzfilename doesn't end in .gz:rirSrS)
sysargvrstdinbufferstdoutprintr[rrArrr)argsrargr1grr#r#r$_tests<


r__main__)rrrr	r
)rr)rrNNN)r)r%rrorrKrArZ_compression__all__ZFTEXTrrrmrrFrIrr(r)Z
BaseStreamrZDecompressReaderrGrrrr7r#r#r#r$<module>s* 
+)

	&

OHA YOOOO