文件操作 - decode.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/httplib2/__pycache__/decode.cpython-310.pyc
编辑文件内容
o 0�PjX � @ sv d dl mZ d dlZG dd� de�ZG dd� de�ZG dd� de�ZG d d � d e�Zdefdd �ZG dd� de�Z dS )� )�ProtocolNc @ � e Zd ZdZdS )�DecodeRatioErrorzBOutput-to-input amplification ratio exceeded the configured limit.N��__name__� __module__�__qualname__�__doc__� r r �1/usr/lib/python3/dist-packages/httplib2/decode.pyr � r c @ r )�DecodeLimitErrorz,Total output length exceeded the hard limit.Nr r r r r r r r c @ sV e Zd Zedefdd��Zdedefdd�Zdefdd�Zdd ede defdd �Z dS )�DecoderProtocol�returnc C � d S �Nr ��selfr r r �needs_input s zDecoderProtocol.needs_input�bc C r r r �r r r r r �decode � zDecoderProtocol.decodec C r r r r r r r �flush r zDecoderProtocol.flush� �data� chunk_sizec C sb t � }|dkrt|�}tdt|�|�D ]}|||| � }|�| �|�� q|�| �� � t|�S )Nr )� bytearray�len�range�extendr r �bytes)r r r �out�i�chunkr r r � consume_bytes s zDecoderProtocol.consume_bytesN)r )r r r �property�boolr r! r r �intr% r r r r r s r c @ sh e Zd ZdZdZdZdZdZdZefde fdd �Z ed efdd��Z d ed efdd�Zd efdd�ZdS )�ZlibDecodera# Thin wrapper around zlib.Decompressor conforming to the Decoder interface. Note: zlib pushes all available decompressed data immediately upon receiving input. It never holds back output requiring `decode(b"")` to extract it. Thus, `needs_input` naturally remains True. )�_decoderi�� � �/ �wbitsc C s t �|�| _d S r )�zlib� decompressobjr* )r r. r r r �__init__3 s zZlibDecoder.__init__r c C s | j d u r td��| j j S �Nzused after flush())r* �RuntimeError�eofr r r r r 6 s zZlibDecoder.needs_inputr c C s | j d u r td��| j �|�S r2 )r* r3 � decompressr r r r r <