ó 9(Zc@sēddlZddlZddlZddlmZddlmZddlm Z m Z m Z ddl m Z ddlmZejeƒZdefd„ƒYZd „ZdS( iĸĸĸĸN(t ScalarTypes(tfirst_non_none_response(tjsontset_socket_timeoutt XMLParseError(tIncompleteReadError(tparserst StreamingBodycBs>eZdZd„Zd„Zdd„Zd„Zd„ZRS(seWrapper class for an http response body. This provides a few additional conveniences that do not exist in the urllib3 model: * Set the timeout on the socket (i.e read() timeouts) * Auto validation of content length, if the amount of bytes we read does not match the content length, an exception is raised. cCs||_||_d|_dS(Ni(t _raw_streamt_content_lengtht _amount_read(tselft raw_streamtcontent_length((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyt__init__)s  cCsByt|j|ƒWn'tk r=tjddtƒ‚nXdS(s&Set the timeout seconds on the socket.sbCannot access the socket object of a streaming response. It's possible the interface has changed.texc_infoN(RRtAttributeErrortloggerterrortTrue(R ttimeout((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyR.s   cCsW|jj|ƒ}|jt|ƒ7_|dksF| rS|dkrS|jƒn|S(shRead at most amt bytes from the stream. If the amt argument is omitted, read all data. iN(RtreadR tlentNonet_verify_content_length(R tamttchunk((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyREs  cCsO|jdk rK|jt|jƒkrKtd|jdt|jƒƒ‚ndS(Nt actual_bytestexpected_bytes(R RR tintR(R ((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyRSs  cCs|jjƒdS(s*Close the underlying http response stream.N(Rtclose(R ((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyR]sN( t__name__t __module__t__doc__RRRRRR(((s3/tmp/pip-build-wDUJoH/botocore/botocore/response.pyRs      cCsŦ|jd}i|jd6|jd6}|ddkrG|j|ds   E