WcG. gdZdZddlmZddlZddlZddlZddlm Z m Z dZ dZ dZ Gdd ejZ dd Zdd ZdZdS))BZ2File BZ2CompressorBZ2Decompressoropencompress decompressz%Nadeem Vawda )rN)rrceZdZ ddddZdZedZdZdZd Z d Z dd Z ddZ ddZ dZddZddZdZdZej(fdZdZdS)rr  compresslevelc` d|_d|_t|_d|cxkrdkst dt d|dvr d}t }np|dvrd}t }t||_nP|d vrd }t }t||_n0|d vrd }t }t||_nt d |t|tttjfr"t|||_d|_||_n8t|dst|dr||_||_n t!d|jt krLt#j$|jt&t(}t+j,||_dSd|_dS)NFr r z%compresslevel must be between 1 and 9)r rbr)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 /usr/lib64/python3.12/bz2.py__init__zBZ2File.__init__%s " ! ]''''a''DE E(DE E ? " "D"II [ D#I,];D   [ D#I,];D   [ D#I,];D  *449: : heR[[ 9 : :$Xt4DH DM"DJJ Xv & &'(G*D*DDH"DJJTU U :: # #//99C,,S1DLLLDIIIc |jtkrdS |jtkr|jj nQ|jt kr<|j j|jjd|_ |jr|j j d|_d|_ t|_d|_dS#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.closease :: % % F $zzZ'' ""$$${**t//55788#'  $===HHNN$$ % ) #   % ) # #### $===HHNN$$ % ) #  $  % ) # #### $ $ $s0BD 'C''#D  E>'E6"E>#E;;E>c. |jtkSN)r rr?s r9closedzBZ2File.closedys*zz\))r;c\ |j|jjSrA)_check_not_closedrfilenor?s r9rEzBZ2File.fileno~s%A   xx  r;c\ |jo|jjSrA)readabler2seekabler?s r9rHzBZ2File.seekables#7}}:4<<#8#8#::r;cP |j|jtkSrA)rDr r"r?s r9rGzBZ2File.readables#=   zzZ''r;cP |j|jtkSrA)rDr r#r?s r9writablezBZ2File.writables#=   zz[((r;rc^ |j|jj|SrA)_check_can_readr2peek)r4ns r9rNz BZ2File.peeks/ ||  ##r;c^ |j|jj|SrA)rMr2rr4sizes r9rz BZ2File.reads- ||  &&r;c |j|dkrtj}|jj |S)Nr)rMr0DEFAULT_BUFFER_SIZEr2read1rRs r9rVz BZ2File.read1sA  !88))D||!!$''r;c^ |j|jj|SrA)rMr2readinto)r4bs r9rXzBZ2File.readintos-  ||$$Q''r;c t|ts,t|ds td|j }|j |j j|SN __index__zInteger argument expected)r%intr+r,r\rMr2readlinerRs r9r^zBZ2File.readlines_ $$$4-- ;<<>>#D ||$$T**r;c t|ts,t|ds td|j }|j |j j|Sr[)r%r]r+r,r\rMr2 readlinesrRs r9r`zBZ2File.readliness_ $$$4-- ;<<>>#D ||%%d++r;cF |jt|ttfrt |}nt |}|j }|jj|}|jj||xj|z c_ |SrA) _check_can_writer%r' bytearraylen memoryviewnbytesr$rrrr3)r4datalength compresseds r9rz BZ2File.writes   dUI. / /YFFd#D[[F%%..t4  z"" V  r;cH tjj||SrA)r- BaseStream writelines)r4seqs r9rlzBZ2File.writeliness" &&11$<)rgrcomps r9rr9s-  'D ==  --r;c g}|rYt} |j|}|j||js t d|j }|rYdj|S#t$r|rY wxYw)NzACompressed data ended before the end-of-stream marker was reachedr;)rrr/appendeofr! unused_datajoin)rgresultsdecompress r9rrDsG $ " ##D)C szzz@A A!! $ 88G    w  sA11 B?B)rr NNN)r )__all__ __author__builtinsrr*r0r(r-_bz2rrrr"r#rkrrrrzr;r9rs  - - -5 ****** ////////   rrrrrl%%rrj-.-1''''T....r;