3 \œã@s’dZddlZddlZddd„Zddd„ZGdd „d ejƒZGd d „d ejƒZGd d „d ejƒZGdd„deejƒZGdd„deej ƒZ dd„Z dS)z•Python 'zlib_codec' Codec - zlib compression encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). éNÚstrictcCs|dks t‚tj|ƒt|ƒfS)Nr)ÚAssertionErrorÚzlibÚcompressÚlen)ÚinputÚerrors©r ú,/usr/lib64/python3.6/encodings/zlib_codec.pyÚ zlib_encode s r cCs|dks t‚tj|ƒt|ƒfS)Nr)rrÚ decompressr)rrr r r Ú zlib_decodes r c@s eZdZddd„Zddd„ZdS) ÚCodecrcCs t||ƒS)N)r )Úselfrrr r r Úencodesz Codec.encodecCs t||ƒS)N)r )rrrr r r Údecodesz Codec.decodeN)r)r)Ú__name__Ú __module__Ú __qualname__rrr r r r rs rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalEncoderrcCs |dks t‚||_tjƒ|_dS)Nr)rrrÚ compressobj)rrr r r Ú__init__s zIncrementalEncoder.__init__FcCs.|r|jj|ƒ}||jjƒS|jj|ƒSdS)N)rrÚflush)rrÚfinalÚcr r r r!s zIncrementalEncoder.encodecCstjƒ|_dS)N)rr)rr r r Úreset(szIncrementalEncoder.resetN)r)F)rrrrrrr r r r rs  rc@s(eZdZd dd„Zd dd„Zdd„Zd S) ÚIncrementalDecoderrcCs |dks t‚||_tjƒ|_dS)Nr)rrrÚ decompressobj)rrr r r r,s zIncrementalDecoder.__init__FcCs.|r|jj|ƒ}||jjƒS|jj|ƒSdS)N)rr r)rrrrr r r r1s zIncrementalDecoder.decodecCstjƒ|_dS)N)rr)rr r r r8szIncrementalDecoder.resetN)r)F)rrrrrrr r r r r+s  rc@seZdZeZdS)Ú StreamWriterN)rrrÚbytesÚcharbuffertyper r r r r;src@seZdZeZdS)Ú StreamReaderN)rrrrr r r r r r!>sr!c Cstjdttttttdd�S)NrF)ÚnamerrÚincrementalencoderÚincrementaldecoderÚ streamreaderÚ streamwriterÚ_is_text_encoding)ÚcodecsÚ CodecInfor r rrr!rr r r r Ú getregentryCsr*)r)r) Ú__doc__r(rr r rrrrr!r*r r r r Ús