Format: application/x-python-code
⬇ Download File (4.2 KB)
   1  o
   2  
   3  7'h��@snddlmZddlZddlZddlmZmZmZmZm	Z	m
   4  Z
   5  mZmZm
   6  Z
   7  mZGdd�d�ZGdd�de�ZdS)	�)�annotationsN�)
   8  �URL�
   9  Extensions�HeaderTypes�Origin�Request�Response�
  10  enforce_bytes�enforce_headers�enforce_url�include_request_headersc@sDeZdZdddd�ddd�Zejdddd�ddd��Zddd�ZdS)�RequestInterfaceN)�headers�content�
  11  extensions�method�bytes | str�url�URL | bytes | strrrr�%bytes | typing.Iterator[bytes] | Noner�Extensions | None�returnr	cCspt|dd�}t|dd�}t|dd�}t|||d�}t|||||d�}|�|�}z|��W|��|S|��w�Nr)�namerr)rr)rrrrr)r
  12  rrr
  13  r�handle_request�read�close��selfrrrrr�request�response�r"�OC:\Users\shubh\Videos\agent\nova\Lib\site-packages\httpcore/_sync/interfaces.pyr s"
  14  �
  15  
  16  
  17  �zRequestInterface.request�typing.Iterator[Response]ccsp�t|dd�}t|dd�}t|dd�}t|||d�}t|||||d�}|�|�}z
  18  |VW|��dS|��wr)r
  19  rrr
  20  rrrrr"r"r#�stream4s ��
  21  zRequestInterface.streamr rcC�t���N��NotImplementedError)rr r"r"r#rS�zRequestInterface.handle_request)rrrrrrrrrrrr	)rrrrrrrrrrrr$)r rrr	)�__name__�
  22  __module__�__qualname__r �
  23  contextlib�contextmanagerr%rr"r"r"r#rs��rc@sReZdZddd�Zddd�Zddd�Zdd
  24  d�Zddd�Zddd�Zddd�Z	dS)�ConnectionInterfacer�NonecCr&r'r(�rr"r"r#rXr*zConnectionInterface.close�strcCr&r'r(r2r"r"r#�info[r*zConnectionInterface.info�originr�boolcCr&r'r()rr5r"r"r#�can_handle_request^r*z&ConnectionInterface.can_handle_requestcCr&)a�
  25          Return `True` if the connection is currently able to accept an
  26          outgoing request.
  27  
  28          An HTTP/1.1 connection will only be available if it is currently idle.
  29  
  30          An HTTP/2 connection will be available so long as the stream ID space is
  31          not yet exhausted, and the connection is not in an error state.
  32  
  33          While the connection is being established we may not yet know if it is going
  34          to result in an HTTP/1.1 or HTTP/2 connection. The connection should be
  35          treated as being available, but might ultimately raise `NewConnectionRequired`
  36          required exceptions if multiple requests are attempted over a connection
  37          that ends up being established as HTTP/1.1.
  38          r(r2r"r"r#�is_availableasz ConnectionInterface.is_availablecCr&)z�
  39          Return `True` if the connection is in a state where it should be closed.
  40  
  41          This either means that the connection is idle and it has passed the
  42          expiry time on its keep-alive, or that server has sent an EOF.
  43          r(r2r"r"r#�has_expireds�zConnectionInterface.has_expiredcCr&)zD
  44          Return `True` if the connection is currently idle.
  45          r(r2r"r"r#�is_idle|szConnectionInterface.is_idlecCr&)z�
  46          Return `True` if the connection has been closed.
  47  
  48          Used when a response is closed to determine if the connection may be
  49          returned to the connection pool or not.
  50          r(r2r"r"r#�	is_closed�r:zConnectionInterface.is_closedN)rr1)rr3)r5rrr6)rr6)
  51  r+r,r-rr4r7r8r9r;r<r"r"r"r#r0Ws
  52  
  53  
  54  
  55  
  56  
  57  	r0)�
  58  __future__rr.�typingZ_modelsrrrrrr	r
  59  rrr
  60  rr0r"r"r"r#�<module>s0C