o ac1@s@ ddlZddlZejZGdddejZGdddejZdS)Nc@s.eZdZ ddZddZddZddZd S) BaseStreamcCs|jrtddS)NzI/O operation on closed file)closed ValueErrorselfrm/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/_compression.py_check_not_closed szBaseStream._check_not_closedcC|s tddS)NzFile not open for reading)readableioUnsupportedOperationrrrr_check_can_read zBaseStream._check_can_readcCr )NzFile not open for writing)writabler r rrrr_check_can_writerzBaseStream._check_can_writecCs(|s td|stddS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r r r seekablerrrr_check_can_seeks   zBaseStream._check_can_seekN)__name__ __module__ __qualname__r rrrrrrrr s  rcspeZdZ ddZdddZfddZdd Zd d Zdd dZddZ ddZ e j fddZ ddZZS)DecompressReadercCsdS)NTrrrrrr $szDecompressReader.readablercKsB||_d|_d|_d|_||_||_|jdi|j|_||_dS)NFrr)_fp_eof_pos_size_decomp_factory _decomp_args _decompressor_trailing_error)rfpZdecomp_factorytrailing_errorZ decomp_argsrrr__init__'s zDecompressReader.__init__csd|_tSN)rsupercloser __class__rrr&;s zDecompressReader.closecCs |jSr$)rrrrrrr?s zDecompressReader.seekablec Cst|9}|d}|t|}||dt|<Wdn1s$wYWdt|SWdt|S1s@wYt|S)NB) memoryviewcastreadlen)rbviewZ byte_viewdatarrrreadintoBs( zDecompressReader.readintorcCs|dkr|S|r |jrdSd} |jjrA|jjp|jt}|s#n<|jdi|j |_z |j ||}Wn$|j y@Ynw|jj rR|jt}|sQt dnd}|j ||}|r^nq|sjd|_|j|_dS|jt|7_|S)NrTzACompressed file ended before the end-of-stream marker was reachedr)readallrreof unused_datarr, BUFFER_SIZErr decompressr Z needs_inputEOFErrorrrr-)rsizer0Zrawblockrrrr,HsH   zDecompressReader.readcCs8g}|tj}r|||tj}s d|S)Nr2)r,sysmaxsizeappendjoin)rchunksr0rrrr3qs   zDecompressReader.readallcCs0|jdd|_d|_|jdi|j|_dS)NrFr)rseekrrrrrrrrr_rewind|s zDecompressReader._rewindcCs|tjkrn/|tjkr|j|}n$|tjkr.|jdkr(|tjr( |tjs!|j|}ntd |||jkr?| n||j8}|dkra|t tj|}|sW |jS|t |8}|dksH|jS)NrzInvalid value for whence: {}) r SEEK_SETSEEK_CURrSEEK_ENDrr,DEFAULT_BUFFER_SIZErformatr@minr-)roffsetwhencer0rrrr?s,           zDecompressReader.seekcCs |jSr$)rrrrrtellszDecompressReader.tell)r)r)rrrr r#r&rr1r,r3r@r rAr?rI __classcell__rrr'rr!s   ) r)r r:rDr6BufferedIOBaser RawIOBaserrrrrs