QfG. gdZdZddlmZddlZddlZddlZddlm Z m Z dZ dZ dZ Gdd ejZ d d Zdd Zd Zy))BZ2File BZ2CompressorBZ2Decompressoropencompress decompressz%Nadeem Vawda )rN)rrceZdZ ddddZdZedZdZdZdZ d Z dd Z dd Z dd Z d ZddZddZdZdZej(fdZdZy)r  compresslevelc  d|_d|_t|_d|cxkrdkst dt d|dvr d}t }ne|dvrd}t }t||_nH|d vrd }t }t||_n+|d vrd }t }t||_nt d |t|tttjfr t|||_d|_||_n2t|ds t|dr||_||_n t!d|jt k(rEt#j$|jt&t(}t+j,||_yd|_y)NFr r z%compresslevel must be between 1 and 9)rrbr)wwbr)xxbr)aabrInvalid mode: Treadwritez6filename must be a str, bytes, file or PathLike object)trailing_errorr)_fp_closefp _MODE_CLOSED_mode ValueError _MODE_READ _MODE_WRITEr _compressor isinstancestrbytesosPathLike _builtin_openhasattr TypeError _compressionDecompressReaderrOSErrorioBufferedReader_buffer_pos)selffilenamemoder mode_coderaws */opt/alt/python312/lib64/python3.12/bz2.py__init__zBZ2File.__init__%sc " ! ]'a'DE E(DE E ? "D"I [ D#I,];D  [ D#I,];D  [ D#I,];D 49: : heR[[ 9 :$Xt4DH DM"DJ Xv &'(G*DDH"DJTU U :: #//9C,,S1DLDIc |jtk(ry |jtk(r|jj nM|jt k(r:|j j|jjd|_ |jr|j j d|_d|_ t|_d|_y#d|_d|_ t|_d|_wxYw# |jr|j j d|_d|_ t|_d|_w#d|_d|_ t|_d|_wxYwxYw)NF) r rr"r2closer#rrr$flushrr4s r9r=z BZ2File.closeas :: %  $zzZ' ""${*t//5578#'  $==HHNN$ % ) #   % ) #  $==HHNN$ % ) #   % ) # s0A;C?&C"C<?E-&E'!E-"E**E-c* |jtk(SN)r rr?s r9closedzBZ2File.closedys*zz\))r;cX |j|jjSrA)_check_not_closedrfilenor?s r9rEzBZ2File.fileno~s"A  xx  r;c\ |jxr|jjSrA)readabler2seekabler?s r9rHzBZ2File.seekables#7}}:4<<#8#8#::r;cJ |j|jtk(SrA)rDr r"r?s r9rGzBZ2File.readables =  zzZ''r;cJ |j|jtk(SrA)rDr r#r?s r9writablezBZ2File.writables =  zz[((r;cZ |j|jj|SrA)_check_can_readr2peek)r4ns r9rNz BZ2File.peeks, ||  ##r;cZ |j|jj|SrA)rMr2rr4sizes r9rz BZ2File.reads* ||  &&r;c |j|dkrtj}|jj |S)Nr)rMr0DEFAULT_BUFFER_SIZEr2read1rQs r9rUz BZ2File.read1s<  !8))D||!!$''r;cZ |j|jj|SrA)rMr2readinto)r4bs r9rWzBZ2File.readintos*  ||$$Q''r;c t|ts't|ds td|j }|j |j j|SN __index__zInteger argument expected)r%intr+r,r[rMr2readlinerQs r9r]zBZ2File.readlinesV $$4- ;<<>>#D ||$$T**r;c t|ts't|ds td|j }|j |j j|SrZ)r%r\r+r,r[rMr2 readlinesrQs r9r_zBZ2File.readlinessV $$4- ;<<>>#D ||%%d++r;c0 |jt|ttfr t |}nt |}|j }|jj|}|jj||xj|z c_ |SrA) _check_can_writer%r' bytearraylen memoryviewnbytesr$rrrr3)r4datalength compresseds r9rz BZ2File.writes{   dUI. /YFd#D[[F%%..t4  z" V  r;cD tjj||SrA)r- BaseStream writelines)r4seqs r9rkzBZ2File.writeliness" &&11$<)rfrcomps r9rr9s-  'D ==  --r;c g}|rSt} |j|}|j||js t d|j }|rSdj|S#t$r|rYwxYw)NzACompressed data ended before the end-of-stream marker was reachedr;)rrr/appendeofr! unused_datajoin)rfresultsdecompress r9rrDsG  " ##D)C szz@A A!!  88G    sA** A97A9)rr NNN)r )__all__ __author__builtinsrr*r0r(r-_bz2rrrr"r#rjrrrrzr;r9rse  -5 * /   rl%%rj-.-1'T.r;