ó
    Ú°›j¹  ã                   ó°   • S SK r S SKJr  S SKJr  S SKJr  S SKJ	r	J
r
  S SKJrJr  S SKJrJrJr  S SKJr  \ R&                  " \5      r " S	 S
\5      rS rg)é    N)ÚIOBase)ÚProtocolError)ÚReadTimeoutError)ÚScalarTypesÚparsers)ÚXMLParseErrorÚset_socket_timeout)ÚIncompleteReadErrorr   ÚResponseStreamingError)Úfirst_non_none_responsec                   ó’   • \ rS rSrSrSrS rS rS rS r	SS	 jr
S
 rS rS rS rS rS r\r\S4S jr\4S jrS rS rS rSrg)ÚStreamingBodyé'   aI  Wrapper 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.

i   c                 ó*   • Xl         X l        SU l        g )Nr   )Ú_raw_streamÚ_content_lengthÚ_amount_read)ÚselfÚ
raw_streamÚcontent_lengths      ÚN/home/mande/repo/quber/.venv/lib/python3.13/site-packages/botocore/response.pyÚ__init__ÚStreamingBody.__init__6   s   € Ø%ÔØ-ÔØˆÕó    c                 ó   • g ©N© ©r   s    r   Ú__del__ÚStreamingBody.__del__;   s   € ð 	r   c                 óz   •  [        U R                  U5        g! [         a    [        R	                  S5        e f = f)z&Set the timeout seconds on the socket.zaCannot access the socket object of a streaming response. It's possible the interface has changed.N)r	   r   ÚAttributeErrorÚloggerÚ	exception)r   Útimeouts     r   r	   Ú StreamingBody.set_socket_timeoutA   s>   € ð	Ü˜t×/Ñ/°Õ9øÜó 	Ü×Ñð;ôð ð	ús   ‚ ™!:c                 óX   •  U R                   R                  5       $ ! [         a     gf = f)NF)r   Úreadabler"   r   s    r   r(   ÚStreamingBody.readableV   s.   € ð	Ø×#Ñ#×,Ñ,Ó.Ð.øÜó 	Ùð	ús   ‚ œ
)¨)Nc                 ó2  •  U R                   R                  U5      nU =R                  [        U5      -  sl        Ub  U(       d  US:”  a  U R                  5         U$ ! [         a  n[        UR                  US9eSnAf[
         a  n[        US9eSnAff = f)zXRead at most amt bytes from the stream.

If the amt argument is omitted, read all data.
©Úendpoint_urlÚerrorN©r-   r   )
r   ÚreadÚURLLib3ReadTimeoutErrorr   ÚurlÚURLLib3ProtocolErrorr   r   ÚlenÚ_verify_content_length)r   ÚamtÚchunkÚes       r   r/   ÚStreamingBody.read\   sŒ   € ð
	2Ø×$Ñ$×)Ñ)¨#Ó.ˆEð 	×ÒœS ›ZÑ'ÕØ‰;žu¨¨q«ð ×'Ñ'Ô)Øˆøô 'ó 	@ä"°·±¸QÑ?Ð?ûÜ#ó 	2Ü(¨qÑ1Ð1ûð	2ús#   ‚A Á
BÁ'A;Á;BÂ	BÂBc                 ó*  •  U R                   R                  U5      nU =R                  U-  sl        US:X  a  [        U5      S:”  a  U R                  5         U$ ! [         a  n[        UR                  US9eSnAf[
         a  n[        US9eSnAff = f)zcRead bytes into a pre-allocated, writable bytes-like object b, and return the number of bytes read.r+   Nr.   r   )
r   Úreadintor0   r   r1   r2   r   r   r3   r4   )r   ÚbÚamount_readr7   s       r   r:   ÚStreamingBody.readintop   sŽ   € ð	2Ø×*Ñ*×3Ñ3°AÓ6ˆKð 	×Ò˜[Ñ(ÕØ˜!Ó¤ A£¨£
ð ×'Ñ'Ô)ØÐøô 'ó 	@ä"°·±¸QÑ?Ð?ûÜ#ó 	2Ü(¨qÑ1Ð1ûð	2ús#   ‚A Á
BÁ#A7Á7BÂ	BÂBc                 ó6   • U R                   R                  5       $ r   )r   Ú	readlinesr   s    r   r?   ÚStreamingBody.readlines€   s   € Ø×Ñ×)Ñ)Ó+Ð+r   c                 ó8   • U R                  U R                  5      $ )z:Return an iterator to yield 1k chunks from the raw stream.)Úiter_chunksÚ_DEFAULT_CHUNK_SIZEr   s    r   Ú__iter__ÚStreamingBody.__iter__ƒ   s   € à×Ñ × 8Ñ 8Ó9Ð9r   c                 ó^   • U R                  U R                  5      nU(       a  U$ [        5       e)z-Return the next 1k chunk from the raw stream.)r/   rC   ÚStopIteration)r   Úcurrent_chunks     r   Ú__next__ÚStreamingBody.__next__‡   s'   € àŸ	™	 $×":Ñ":Ó;ˆÞØ Ð Ü‹oÐr   c                 ó   • U R                   $ r   )r   r   s    r   Ú	__enter__ÚStreamingBody.__enter__Ž   s   € Ø×ÑÐr   c                 ó8   • U R                   R                  5         g r   ©r   Úclose)r   ÚtypeÚvalueÚ	tracebacks       r   Ú__exit__ÚStreamingBody.__exit__‘   s   € Ø×Ñ×ÑÕ r   Fc              #   óð   #   • SnU R                  U5       H=  nX4-   R                  S5      nUSS  H  nUR                  U5      S   v •  M     US   nM?     U(       a  UR                  U5      S   v •  gg7f)z»Return an iterator to yield lines from the raw stream.

This is achieved by reading chunk of bytes (of size chunk_size) at a
time from the raw stream, and then yielding lines from there.
r   TNéÿÿÿÿr   )rB   Ú
splitlines)r   Ú
chunk_sizeÚkeependsÚpendingr6   ÚlinesÚlines          r   Ú
iter_linesÚStreamingBody.iter_lines–   s€   é € ð ˆØ×%Ñ% jÖ1ˆEØ‘_×0Ñ0°Ó6ˆEØ˜c˜r›
�Ø—o‘o hÓ/°Ñ2Ô2ñ #à˜B‘iŠGñ	 2ö
 Ø×$Ñ$ XÓ.¨qÑ1Ó1ð ùs   ‚A4A6c              #   óH   #   •  U R                  U5      nUS:X  a  gUv •  M  7f)zLReturn an iterator to yield chunks of chunk_size bytes from the raw
stream.
r   N)r/   )r   rY   rH   s      r   rB   ÚStreamingBody.iter_chunks¥   s.   é € ð Ø ŸI™I jÓ1ˆMØ Ó#ØØÒñ	 ùs   ‚ "c                 ó´   • U R                   bK  U R                  [        U R                   5      :w  a'  [        U R                  [        U R                   5      S9eg g )N)Úactual_bytesÚexpected_bytes)r   r   Úintr
   r   s    r   r4   Ú$StreamingBody._verify_content_length¯   s\   € ð ×ÑÑ+°×0AÑ0AÄSØ× Ñ óF
ó 1
ô &Ø!×.Ñ.Ü" 4×#7Ñ#7Ó8ñð ð1
Ð+r   c                 ó6   • U R                   R                  5       $ r   )r   Útellr   s    r   rh   ÚStreamingBody.tell»   s   € Ø×Ñ×$Ñ$Ó&Ð&r   c                 ó8   • U R                   R                  5         g)z*Close the underlying http response stream.NrO   r   s    r   rP   ÚStreamingBody.close¾   s   € à×Ñ×ÑÕ r   )r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rC   r   r   r	   r(   r/   r:   r?   rD   rI   rL   rT   Únextr^   rB   r4   rh   rP   Ú__static_attributes__r   r   r   r   r   '   sp   † ñ
ð Ðòò
òò*ôò(ò ,ò:òò ò!ð €Dà$7À%ô 2ð &9ô  ò
ò'õ!r   r   c                 óŽ  • U R                   R                  nUR                  UR                  S.nUS   S:¼  a  UR                  US'   OLU R
                  (       a,  [        UR                  US   R                  S5      5      US'   OUR                  US'   [        R                  " U5      nXR                  X0R                  5      4$ )N)ÚheadersÚstatus_coderu   i,  Úbodyrt   zcontent-length)Úservice_modelÚresolved_protocolrt   ru   ÚcontentÚhas_streaming_outputr   ÚrawÚgetr   Úcreate_parserÚparseÚoutput_shape)Úoperation_modelÚhttp_responseÚprotocolÚresponse_dictÚparsers        r   Úget_responser…   Ã   sÀ   € Ø×,Ñ,×>Ñ>€Hà ×(Ñ(Ø$×0Ñ0ñ€Mð �]Ñ# sÓ*Ø -× 5Ñ 5ˆ�fÒØ	×	-×	-Ü -Ø×Ñ˜}¨YÑ7×;Ñ;Ð<LÓMó!
ˆ�fÒð !.× 5Ñ 5ˆ�fÑä×"Ò" 8Ó,€FØŸ,™,Ø×3Ñ3óð ð r   )ÚloggingÚior   Úurllib3.exceptionsr   r2   r   r0   Úbotocorer   r   Úbotocore.compatr   r	   Úbotocore.exceptionsr
   r   Úbotocore.hooksr   Ú	getLoggerrl   r#   r   r…   r   r   r   Ú<module>rŽ      sP   ðó Ý å DÝ J÷÷÷ñ õ
 3à	×	Ò	˜8Ó	$€ôY!�Fô Y!óxr   