Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/encodings/zlib_codec.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s�dZddlZddlZdd�Zdd�Zdejfd��YZdejfd	��YZd
ejfd��YZdeejfd
��YZdeej	fd��YZ	d�Z
dS(s� Python 'zlib_codec' Codec - zlib compression encoding

    Unlike most of the other codecs which target Unicode, this codec
    will return Python string objects for both encode and decode.

    Written by Marc-Andre Lemburg ([email protected]).

i�NtstrictcCs1|dkst�tj|�}|t|�fS(s Encodes the object input and returns a tuple (output
        object, length consumed).

        errors defines the error handling to apply. It defaults to
        'strict' handling which is the only currently supported
        error handling for this codec.

    R(tAssertionErrortzlibtcompresstlen(tinputterrorstoutput((s*/sys/lib/python2.7/encodings/zlib_codec.pytzlib_encodes
cCs1|dkst�tj|�}|t|�fS(s� Decodes the object input and returns a tuple (output
        object, length consumed).

        input must be an object which provides the bf_getreadbuf
        buffer slot. Python strings, buffer objects and memory
        mapped files are examples of objects providing this slot.

        errors defines the error handling to apply. It defaults to
        'strict' handling which is the only currently supported
        error handling for this codec.

    R(RRt
decompressR(RRR((s*/sys/lib/python2.7/encodings/zlib_codec.pytzlib_decodestCodeccBs eZdd�Zdd�ZRS(RcCs
t||�S(N(R(tselfRR((s*/sys/lib/python2.7/encodings/zlib_codec.pytencode0scCs
t||�S(N(R
(RRR((s*/sys/lib/python2.7/encodings/zlib_codec.pytdecode2s(t__name__t
__module__R
R(((s*/sys/lib/python2.7/encodings/zlib_codec.pyR.stIncrementalEncodercBs)eZdd�Zed�Zd�ZRS(RcCs.|dkst�||_tj�|_dS(NR(RRRtcompressobj(RR((s*/sys/lib/python2.7/encodings/zlib_codec.pyt__init__6s	cCs=|r)|jj|�}||jj�S|jj|�SdS(N(RRtflush(RRtfinaltc((s*/sys/lib/python2.7/encodings/zlib_codec.pyR
;scCstj�|_dS(N(RR(R((s*/sys/lib/python2.7/encodings/zlib_codec.pytresetBs(RRRtFalseR
R(((s*/sys/lib/python2.7/encodings/zlib_codec.pyR5stIncrementalDecodercBs)eZdd�Zed�Zd�ZRS(RcCs.|dkst�||_tj�|_dS(NR(RRRt
decompressobj(RR((s*/sys/lib/python2.7/encodings/zlib_codec.pyRFs	cCs=|r)|jj|�}||jj�S|jj|�SdS(N(RR	R(RRRR((s*/sys/lib/python2.7/encodings/zlib_codec.pyRKscCstj�|_dS(N(RR(R((s*/sys/lib/python2.7/encodings/zlib_codec.pyRRs(RRRRRR(((s*/sys/lib/python2.7/encodings/zlib_codec.pyREstStreamWritercBseZRS((RR(((s*/sys/lib/python2.7/encodings/zlib_codec.pyRUstStreamReadercBseZRS((RR(((s*/sys/lib/python2.7/encodings/zlib_codec.pyRXscCs4tjdddtdtdtdtdtdt�S(	NtnameRR
Rtincrementalencodertincrementaldecodertstreamreadertstreamwriter(tcodecst	CodecInfoRR
RRRR(((s*/sys/lib/python2.7/encodings/zlib_codec.pytgetregentry]s	(t__doc__R"RRR
RRRRRR$(((s*/sys/lib/python2.7/encodings/zlib_codec.pyt<module>s

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].