grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jYUã@s ddlZddlZddlZddlZddlZddlZddlZddlZgd¢Zd\Z Z Z Z Z d\ZZdZdZdZdedddfd d „Zd d „ZGd d„dƒZGdd„deƒZGdd„dejƒZGdd„dejƒZefddœdd„Zdd„Zdd„ZedkreƒdSdS)éN)Ú BadGzipFileÚGzipFileÚopenÚcompressÚ decompress)ééééé)rrréé ÚrbcCsÐ d|vrd|vrtd|fƒ‚n|durtdƒ‚|dur!tdƒ‚|dur)tdƒ‚| dd¡}t|tttjfƒr?t|||ƒ}nt|dƒsIt|d ƒrQtd|||ƒ}nt d ƒ‚d|vrft   |¡}t   ||||¡S|S) 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ÚbytesÚosÚPathLikerÚhasattrÚ TypeErrorÚioÚ text_encodingÚ TextIOWrapper)ÚfilenameÚmodeÚ compresslevelÚencodingÚerrorsÚnewlineZgz_modeZ binary_file©r&ú+/opt/alt/python310/lib64/python3.10/gzip.pyrs*ÿ  rcCs| t d|¡¡dS)Nz|jdur ||_n |jt|ƒ8_dSt|jƒ|_d|_dSr.)r3r/r0r1)r4r6r&r&r'r6cs   z_PaddedFile.prependcCsd|_d|_|j |¡Sr8)r3r/r2Úseek)r4Zoffr&r&r'r:ls z_PaddedFile.seekcCódS©NTr&©r4r&r&r'Úseekableqóz_PaddedFile.seekableN)r-)Ú__name__Ú __module__Ú __qualname__r7rr6r:r>r&r&r&r'r,Ks   r,c@s eZdZdS)rN)r@rArBr&r&r&r'rusrc@sÜeZdZ dZddeddfdd„Zedd„ƒZedd„ƒZdd „Z d d „Z d d „Z dd„Z d+dd„Z d+dd„Zdd„Zedd„ƒZdd„Zejfdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zejfd'd(„Zd+d)d*„ZdS),rNc CsX |rd|vs d|vrtd |¡ƒ‚|rd|vr|d7}|dur+t ||p&d¡}|_|dur?t|ddƒ}t|ttfƒs>d}nt   |¡}|}|durPt|ddƒ}|  d ¡rft |_ t|ƒ}t |¡|_||_n5|  d ¡r”|durzd dl}| d td ¡t|_ | |¡t |tjtj tjd ¡|_||_ntd |¡ƒ‚||_|j tkrª|  |¡dSdS)NrÚUzInvalid mode: {!r}rrÚnamerr!Úr)ÚwÚaÚxrz‡GzipFile was opened for writing, but this will change in future Python releases. Specify the mode argument for opening it for writing.r)!rÚformatÚbuiltinsrÚ myfileobjÚgetattrrrrrÚfspathÚ startswithÚREADr!Ú _GzipReaderrÚBufferedReaderr/rDÚwarningsÚwarnÚ FutureWarningÚWRITEÚ _init_writeÚzlibZ compressobjZDEFLATEDÚ MAX_WBITSZ DEF_MEM_LEVELrÚ _write_mtimeÚfileobjÚ_write_gzip_header) r4r r!r"rZÚmtimeZorigmodeÚrawrRr&r&r'r7†sT!  €     ü ü ÿzGzipFile.__init__cCsBddl}| dtd¡|jtkr|jdd…dkr|jdS|jS)Nrzuse the name attributeréýÿÿÿú.gz)rRrSÚDeprecationWarningr!rUrD)r4rRr&r&r'r ×s  zGzipFile.filenamecCs |jjjSr8)r/r]Ú _last_mtimer=r&r&r'r\ßs zGzipFile.mtimecCs.t|jƒ}d|dd…dtt|ƒƒdS)Nz)ÚreprrZÚhexÚid)r4Úsr&r&r'Ú__repr__äs $zGzipFile.__repr__cCs.||_t d¡|_d|_g|_d|_d|_dS©Nr-r)rDrWÚcrc32Úcrcr9ZwritebufÚbufsizeÚoffset)r4r r&r&r'rVès   zGzipFile._init_writecCs|j d¡|j d¡ztj |j¡}t|tƒs| d¡}|  d¡r)|dd…}Wn t y5d}Ynwd}|rvr?zGzipFile.seekablecCs¬|jtkrC|tjkr|tjkr|j|}ntdƒ‚||jkr"tdƒ‚||j}d}t|dƒD]}|  |¡q/|  d|d¡|jS|jt krS|  ¡|j   ||¡S|jS)NzSeek from end not supportedzNegative seek in write modesirs)r!rUrÚSEEK_SETÚSEEK_CURrnrrƒÚrangerrOr�r/r:)r4rnÚwhenceÚcountÚchunkÚir&r&r'r:ys"        üz GzipFile.seekcCs| ¡|j |¡Sr8)r�r/Úreadline)r4r9r&r&r'r¢�s zGzipFile.readline©rb)r@rArBrKr~r7Úpropertyr r\rirVr[rrr�rŽr‘r”rWZ Z_SYNC_FLUSHr“r•r–r˜ršr>rr›r:r¢r&r&r&r'rys8  ÿQ      rcsZeZdZ‡fdd„Zdd„Zdd„Zdd„Zdd d „Zd d „Zdd„Z ‡fdd„Z ‡Z S)rPcs,tƒjt|ƒtjtj d�d|_d|_dS)N)ZwbitsT)Úsuperr7r,rWZ decompressobjrXÚ _new_memberra)r4Úfp©Ú __class__r&r'r7“s ÿ z_GzipReader.__init__cCst d¡|_d|_dSrj)rWrkÚ_crcÚ _stream_sizer=r&r&r'Ú _init_readšs  z_GzipReader._init_readcCsR |j |¡}t|ƒ|kr'|j |t|ƒ¡}|stdƒ‚||7}t|ƒ|ks |S)NúACompressed file ended before the end-of-stream marker was reached)Ú_fprr0ÚEOFError)r4r�rˆrr&r&r'Ú _read_exactžs   ûz_GzipReader._read_exactcCsÞ|j d¡}|dkr dS|dkrtd|ƒ‚t d| d¡¡\}}|_|dkr+tdƒ‚|t@r>t d | d¡¡\}| |¡|t@rQ |j d ¡}|rO|d krPnqC|t @rd |j d ¡}|rb|d krcnqV|t @rm| d¡d S) Nrr-FrozNot a gzipped file (%r)zÿ  Þ %z_GzipReader.readcCs$t ||j¡|_|jt|ƒ|_dSr8)rWrkrªr«r0)r4rˆr&r&r'r¼sz_GzipReader._add_read_datacCsˆt d| d¡¡\}}||jkrtdt|ƒt|jƒfƒ‚||jd@kr(tdƒ‚d}|dkr8|j d¡}|dks.|rB|j  |¡dSdS)Nz tt |¡d�� }| ¡WdƒS1swYdS)Nr�)rrrÂr)rˆr5r&r&r'r(s$ÿrc Csˆddlm}|dd�}| ¡}|jdddd�|jd dd d�|jd d dd d�|jdddgdd�| ¡}t}|jr>t}n|jrCt }|j D]{}|j r}|dkr]t ddt jjd�}t jj}n@|dd…dkrmt  d|›�¡t|dƒ}t |dd…d¡}n |dkr�t jj}t ddt jj|d�}n t |d¡}t|ddƒ} | tj¡}|s§n| |¡qž|t jjur·| ¡|t jjurÁ| ¡qFdS)Nr)ÚArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Ú descriptionz--fastÚ store_truezcompress faster)ÚactionÚhelpz--bestzcompress betterz-dz --decompresszact like gunzip instead of gzipÚargsÚ*ú-r2)ÚnargsÚdefaultÚmetavarrr)r r!rZr^r_zfilename doesn't end in .gz: rÁ)r r!rZr")ÚargparserÄZadd_mutually_exclusive_groupÚ add_argumentÚ parse_argsÚ_COMPRESS_LEVEL_TRADEOFFZfastrZbestr~rÉrrÚsysÚstdinÚbufferÚstdoutÚexitrrJrrrŒrr”) rÄÚparserÚgrouprÉr"Úargr5Úgr r&r&r'Úmain0sZ ÿ ÿ    ÿ   ü  €ærÜÚ__main__) r(rÓr|rrWrJrZ _compressionÚ__all__ZFTEXTr´r²rzr³rOrUrrÒr~rr+r,rƒrZ BaseStreamrZDecompressReaderrPrrrÜr@r&r&r&r'Ús:  ÿ-* 0 ÿ