grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026 й¼]$Oã@sRddlZddlZddlZddlZddlZddlZddlZddlZddddgZdddd d f\Z Z Z Z Z ddf\ZZd d dddd d„Zdd„ZGdd„dƒZGdd„dejƒZGdd„dejƒZd dd„Zdd„Zdd„ZedkrNeƒdS)éNÚGzipFileÚopenÚcompressÚ decompresséééééÚrbé cCsd|kr.d|krvtd|fƒ‚nH|dk rFtdƒ‚|dk r^tdƒ‚|dk rvtdƒ‚|jddƒ}t|ttfƒr²t|||ƒ}nBt|dƒsÐt|d ƒrètd|||ƒ}n td ƒ‚d|krtj ||||ƒS|SdS) NÚtÚbzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary modeÚÚreadÚwritez1filename must be a str or bytes object, or a file) Ú ValueErrorÚreplaceÚ isinstanceÚstrÚbytesrÚhasattrÚ TypeErrorÚioÚ TextIOWrapper)ÚfilenameÚmodeÚ compresslevelÚencodingÚerrorsÚnewlineZgz_modeÚ binary_file©r"ú)/opt/alt/python35/lib64/python3.5/gzip.pyrs$          cCs|jtjd|ƒƒdS)Nzr?)rÚformatÚbuiltinsrÚ myfileobjÚgetattrrrrÚ startswithÚREADrÚ _GzipReaderrÚBufferedReaderr+r;ÚWRITEÚ _init_writeÚzlibÚ compressobjÚDEFLATEDÚ MAX_WBITSÚ DEF_MEM_LEVELrÚ _write_mtimeÚfileobjÚ_write_gzip_header)r0rrrrPÚmtimeÚrawr"r"r#r3{s<#             zGzipFile.__init__cCsYddl}|jdtdƒ|jtkrR|jdd…dkrR|jdS|jS)Nrzuse the name attributeréz.gzéýÿÿÿ)ÚwarningsÚwarnÚDeprecationWarningrrHr;)r0rVr"r"r#rÂs  ( zGzipFile.filenamecCs |jjjS)N)r+rSÚ _last_mtime)r0r"r"r#rRÊszGzipFile.mtimecCs9t|jƒ}d|dd…dtt|ƒƒdS)Nzéÿÿÿÿ)ÚreprrPÚhexÚid)r0Úsr"r"r#Ú__repr__ÏszGzipFile.__repr__cCsC||_tjdƒ|_d|_g|_d|_d|_dS)Nr*r)r;rJÚcrc32Úcrcr4ZwritebufÚbufsizeÚoffset)r0rr"r"r#rIÓs     zGzipFile._init_writec Cs7|jjdƒ|jjdƒyVtjj|jƒ}t|tƒsV|jdƒ}|j dƒru|dd …}Wnt k r�d}YnXd}|r£t }|jjt |ƒjdƒƒ|j }|dkrãtjƒ}t|jt|ƒƒ|jjdƒ|jjd ƒ|r3|jj|d ƒdS) Ns‹szlatin-1s.gzrTr*rssÿsrU)rPrÚosÚpathÚbasenamer;rrÚencodeÚendswithÚUnicodeEncodeErrorÚFNAMEÚchrrOÚtimer(Úint)r0ZfnameÚflagsrRr"r"r#rQÛs,     zGzipFile._write_gzip_headercCsç|jƒ|jtkr7ddl}t|jdƒ‚|jdkrRtdƒ‚t|t ƒrpt |ƒ}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_closedrrHÚerrnoÚOSErrorÚEBADFrPrrrr,Ú memoryviewÚnbytesrrr4rJrbrcre)r0ÚdatarrÚlengthr"r"r#rõs       zGzipFile.writercCsG|jƒ|jtkr7ddl}t|jdƒ‚|jj|ƒS)Nrz$read() on write-only GzipFile object)rqrrErrrsrtr+r)r0r4rrr"r"r#r s   z GzipFile.readcCs\|jƒ|jtkr7ddl}t|jdƒ‚|dkrLtj}|jj |ƒS)Nrz%read1() on write-only GzipFile object) rqrrErrrsrtrÚDEFAULT_BUFFER_SIZEr+Úread1)r0r4rrr"r"r#rzs    zGzipFile.read1cCsG|jƒ|jtkr7ddl}t|jdƒ‚|jj|ƒS)Nrz$peek() on write-only GzipFile object)rqrrErrrsrtr+Úpeek)r0Únrrr"r"r#r{!s   z GzipFile.peekcCs |jdkS)N)rP)r0r"r"r#Úclosed(szGzipFile.closedc Cs¸|j}|dkrdSd|_zl|jtkrq|j|jjƒƒt||jƒt||jd@ƒn|jt kr�|j j ƒWd|j }|r³d|_ |j ƒXdS)Nlÿÿ) rPrrHrrÚflushr(rcr4rEr+ÚcloserB)r0rPrBr"r"r#r,s     zGzipFile.closecCsF|jƒ|jtkrB|jj|jj|ƒƒ|jjƒdS)N)rqrrHrPrrr~)r0Z zlib_moder"r"r#r~?s zGzipFile.flushcCs |jjƒS)N)rPÚfileno)r0r"r"r#r€FszGzipFile.filenocCs/|jtkrtdƒ‚|jjdƒdS)NzCan't rewind in write moder)rrErsr+r5)r0r"r"r#ÚrewindNs zGzipFile.rewindcCs |jtkS)N)rrE)r0r"r"r#ÚreadableUszGzipFile.readablecCs |jtkS)N)rrH)r0r"r"r#ÚwritableXszGzipFile.writablecCsdS)NTr")r0r"r"r#r6[szGzipFile.seekablecCsò|jtkr¿|tjkrI|tjkr=|j|}n tdƒ‚||jkrdtdƒ‚||j}tdƒ}x%t |dƒD]}|j |ƒqŽW|j t|dƒƒn,|jt krë|j ƒ|j j||ƒS|jS)NzSeek from end not supportedzNegative seek in write modei)rrHrÚSEEK_SETÚSEEK_CURrerrsrÚrangerrErqr+r5)r0reÚwhenceÚcountÚchunkÚir"r"r#r5^s      z GzipFile.seekcCs|jƒ|jj|ƒS)N)rqr+Úreadline)r0r4r"r"r#r‹rs zGzipFile.readliner\r\r\)r7r8r9rBr3ÚpropertyrrRrarIrQrrrzr{r}rrJÚ Z_SYNC_FLUSHr~r€r�r‚rƒr6rr„r5r‹r"r"r"r#rns, F           cseZdZ‡fdd†Zdd„Zdd„Zdd„Zdd d „Zd d „Zdd„Z ‡fdd†Z ‡S)rFcs<tƒjt|ƒtjdtj ƒd|_d|_dS)NZwbitsT)Úsuperr3r)rJÚ decompressobjrMÚ _new_memberrY)r0Úfp)Ú __class__r"r#r3xs  z_GzipReader.__init__cCstjdƒ|_d|_dS)Nr*r)rJrbÚ_crcÚ _stream_size)r0r"r"r#Ú _init_readsz_GzipReader._init_readcCsg|jj|ƒ}xNt|ƒ|krb|jj|t|ƒƒ}|sUtdƒ‚||7}qW|S)NzACompressed file ended before the end-of-stream marker was reached)Ú_fprr,ÚEOFError)r0r|rwrr"r"r#Ú _read_exactƒs z_GzipReader._read_exactcCs;|jjdƒ}|dkr"dS|dkr>td|ƒ‚tjd|jdƒƒ\}}|_|dkr}tdƒ‚|t@r²tjd |jdƒƒ\}|j|ƒ|t@réx*|jjd ƒ}| sä|d kr¿Pq¿W|t @r x*|jjd ƒ}| s|d kröPqöW|t @r7|jdƒd S) Nrr*Fs‹zNot a gzipped file (%r)zs&0    $+ )ÿ �  &