
    vKgST                        S r SSKrSSKJrJr   " S S5      r " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r	 " S S\	5      r
 " S S\	5      r " S S\	5      r " S S\	5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r " S! S"\5      r " S# S$\5      r " S% S&\5      r " S' S(\5      r " S) S*\5      r " S+ S,\5      r " S- S.\5      r " S/ S0\5      r " S1 S2\5      rS3 rg)4a  
h2/events
~~~~~~~~~

Defines Event types for HTTP/2.

Events are returned by the H2 state machine to allow implementations to keep
track of events triggered by receiving data. Each time data is provided to the
H2 state machine it processes the data and returns a list of Event objects.
    N   )ChangedSetting_setting_code_from_intc                       \ rS rSrSrSrg)Event   z
Base class for h2 events.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r	       I/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/h2/events.pyr   r      s     	r   r   c                   $    \ rS rSrSrS rS rSrg)RequestReceived   a  
The RequestReceived event is fired whenever request headers are received.
This event carries the HTTP headers for the given request and the stream ID
of the new stream.

.. versionchanged:: 2.3.0
   Changed the type of ``headers`` to :class:`HeaderTuple
   <hpack:hpack.HeaderTuple>`. This has no effect on current users.

.. versionchanged:: 2.4.0
   Added ``stream_ended`` and ``priority_updated`` properties.
c                 <    S U l         S U l        S U l        S U l        g N	stream_idheadersstream_endedpriority_updatedselfs    r   __init__RequestReceived.__init__%   &      ! !%r   c                 @    SU R                   < SU R                  < S3$ )Nz<RequestReceived stream_id:
, headers:>r   r   r   s    r   __repr__RequestReceived.__repr__:       NNDLL
 	
r   r   r   r   r   Nr   r   r   r   r   r   r&   r   r	   r   r   r   r          %*
r   r   c                   $    \ rS rSrSrS rS rSrg)ResponseReceived@   a  
 The ResponseReceived event is fired whenever response headers are received.
 This event carries the HTTP headers for the given response and the stream
 ID of the new stream.

 .. versionchanged:: 2.3.0
    Changed the type of ``headers`` to :class:`HeaderTuple
    <hpack:hpack.HeaderTuple>`. This has no effect on current users.

.. versionchanged:: 2.4.0
   Added ``stream_ended`` and ``priority_updated`` properties.
 c                 <    S U l         S U l        S U l        S U l        g r   r   r   s    r   r   ResponseReceived.__init__M   r!   r   c                 @    SU R                   < SU R                  < S3$ )Nz<ResponseReceived stream_id:r#   r$   r%   r   s    r   r&   ResponseReceived.__repr__b   r(   r   r)   Nr*   r	   r   r   r-   r-   @   r+   r   r-   c                   $    \ rS rSrSrS rS rSrg)TrailersReceivedh   ah  
The TrailersReceived event is fired whenever trailers are received on a
stream. Trailers are a set of headers sent after the body of the
request/response, and are used to provide information that wasn't known
ahead of time (e.g. content-length). This event carries the HTTP header
fields that form the trailers and the stream ID of the stream on which they
were received.

.. versionchanged:: 2.3.0
   Changed the type of ``headers`` to :class:`HeaderTuple
   <hpack:hpack.HeaderTuple>`. This has no effect on current users.

.. versionchanged:: 2.4.0
   Added ``stream_ended`` and ``priority_updated`` properties.
c                 <    S U l         S U l        S U l        S U l        g r   r   r   s    r   r   TrailersReceived.__init__x   s&      ! !%r   c                 @    SU R                   < SU R                  < S3$ )Nz<TrailersReceived stream_id:r#   r$   r%   r   s    r   r&   TrailersReceived.__repr__   r(   r   r)   Nr*   r	   r   r   r4   r4   h   s    %(
r   r4   c                       \ rS rSrSrSrg)_HeadersSent   z
The _HeadersSent event is fired whenever headers are sent.

This is an internal event, used to determine validation steps on
outgoing header blocks.
r	   Nr
   r	   r   r   r;   r;      s     	r   r;   c                       \ rS rSrSrSrg)_ResponseSent   z
The _ResponseSent event is fired whenever response headers are sent
on a stream.

This is an internal event, used to determine validation steps on
outgoing header blocks.
r	   Nr
   r	   r   r   r>   r>           	r   r>   c                       \ rS rSrSrSrg)_RequestSent   z
The _RequestSent event is fired whenever request headers are sent
on a stream.

This is an internal event, used to determine validation steps on
outgoing header blocks.
r	   Nr
   r	   r   r   rB   rB      r@   r   rB   c                       \ rS rSrSrSrg)_TrailersSent   aJ  
The _TrailersSent event is fired whenever trailers are sent on a
stream. Trailers are a set of headers sent after the body of the
request/response, and are used to provide information that wasn't known
ahead of time (e.g. content-length).

This is an internal event, used to determine validation steps on
outgoing header blocks.
r	   Nr
   r	   r   r   rE   rE      s     	r   rE   c                       \ rS rSrSrSrg)_PushedRequestSent   z
The _PushedRequestSent event is fired whenever pushed request headers are
sent.

This is an internal event, used to determine validation steps on outgoing
header blocks.
r	   Nr
   r	   r   r   rH   rH      r@   r   rH   c                   $    \ rS rSrSrS rS rSrg)InformationalResponseReceived   a  
The InformationalResponseReceived event is fired when an informational
response (that is, one whose status code is a 1XX code) is received from
the remote peer.

The remote peer may send any number of these, from zero upwards. These
responses are most commonly sent in response to requests that have the
``expect: 100-continue`` header field present. Most users can safely
ignore this event unless you are intending to use the
``expect: 100-continue`` flow, or are for any reason expecting a different
1XX status code.

.. versionadded:: 2.2.0

.. versionchanged:: 2.3.0
   Changed the type of ``headers`` to :class:`HeaderTuple
   <hpack:hpack.HeaderTuple>`. This has no effect on current users.

.. versionchanged:: 2.4.0
   Added ``priority_updated`` property.
c                 .    S U l         S U l        S U l        g r   )r   r   r   r   s    r   r   &InformationalResponseReceived.__init__   s       !%r   c                 @    SU R                   < SU R                  < S3$ )Nz)<InformationalResponseReceived stream_id:r#   r$   r%   r   s    r   r&   &InformationalResponseReceived.__repr__   r(   r   )r   r   r   Nr*   r	   r   r   rK   rK      s    *%
r   rK   c                   $    \ rS rSrSrS rS rSrg)DataReceived   z
The DataReceived event is fired whenever data is received on a stream from
the remote peer. The event carries the data itself, and the stream ID on
which the data was received.

.. versionchanged:: 2.4.0
   Added ``stream_ended`` property.
c                 <    S U l         S U l        S U l        S U l        g r   )r   dataflow_controlled_lengthr   r   s    r   r   DataReceived.__init__   s&     	 '+# !r   c           
      t    SU R                   < SU R                  < S[        U R                  S S 5      < S3$ )Nz<DataReceived stream_id:z, flow_controlled_length:z, data:   r$   )r   rV   _bytes_representationrU   r   s    r   r&   DataReceived.__repr__  s0    
 ++%diin5	
r   )rU   rV   r   r   Nr*   r	   r   r   rR   rR      s    !(	
r   rR   c                   $    \ rS rSrSrS rS rSrg)WindowUpdatedi  a^  
The WindowUpdated event is fired whenever a flow control window changes
size. HTTP/2 defines flow control windows for connections and streams: this
event fires for both connections and streams. The event carries the ID of
the stream to which it applies (set to zero if the window update applies to
the connection), and the delta in the window size.
c                      S U l         S U l        g r   r   deltar   s    r   r   WindowUpdated.__init__&  s      
r   c                 @    SU R                   < SU R                  < S3$ )Nz<WindowUpdated stream_id:z, delta:r$   r_   r   s    r   r&   WindowUpdated.__repr__.  s    NNDJJ
 	
r   )r`   r   Nr*   r	   r   r   r]   r]     s    
r   r]   c                   4    \ rS rSrSrS r\S 5       rS rSr	g)RemoteSettingsChangedi4  a  
The RemoteSettingsChanged event is fired whenever the remote peer changes
its settings. It contains a complete inventory of changed settings,
including their previous values.

In HTTP/2, settings changes need to be acknowledged. h2 automatically
acknowledges settings changes for efficiency. However, it is possible that
the caller may not be happy with the changed setting.

When this event is received, the caller should confirm that the new
settings are acceptable. If they are not acceptable, the user should close
the connection with the error code :data:`PROTOCOL_ERROR
<h2.errors.ErrorCodes.PROTOCOL_ERROR>`.

.. versionchanged:: 2.0.0
   Prior to this version the user needed to acknowledge settings changes.
   This is no longer the case: h2 now automatically acknowledges
   them.
c                     0 U l         g r   changed_settingsr   s    r   r   RemoteSettingsChanged.__init__H       !#r   c                     U " 5       nUR                  5        H;  u  pE[        U5      nUR                  U5      n[        XFU5      nXsR                  U'   M=     U$ )aZ  
Build a RemoteSettingsChanged event from a set of changed settings.

:param old_settings: A complete collection of old settings, in the form
                     of a dictionary of ``{setting: value}``.
:param new_settings: All the changed settings and their new values, in
                     the form of a dictionary of ``{setting: value}``.
)itemsr   getr   rh   )clsold_settingsnew_settingsesetting	new_valueoriginal_valuechanges           r   from_settings#RemoteSettingsChanged.from_settingsN  s\     E"."4"4"6G,W5G)--g6N#GYGF*0w'	 #7 r   c                 l    SSR                  S U R                  R                  5        5       5      < S3$ )Nz)<RemoteSettingsChanged changed_settings:{, c              3   6   #    U H  n[        U5      v   M     g 7fr   repr.0css     r   	<genexpr>1RemoteSettingsChanged.__repr__.<locals>.<genexpr>c       H)G2d2hh)G   }>joinrh   valuesr   s    r   r&   RemoteSettingsChanged.__repr__a  -    IIH)>)>)E)E)GHH
 	
r   rg   N)
r   r   r   r   r   r   classmethodrv   r&   r   r	   r   r   re   re   4  s%    &#  $
r   re   c                   $    \ rS rSrSrS rS rSrg)PingReceivedig  z
The PingReceived event is fired whenever a PING is received. It contains
the 'opaque data' of the PING frame. A ping acknowledgment with the same
'opaque data' is automatically emitted after receiving a ping.

.. versionadded:: 3.1.0
c                     S U l         g r   	ping_datar   s    r   r   PingReceived.__init__o  	    r   c                 6    S[        U R                  5      < S3$ )Nz<PingReceived ping_data:r$   rZ   r   r   s    r   r&   PingReceived.__repr__s      !$..1
 	
r   r   Nr*   r	   r   r   r   r   g  s    
r   r   c                   $    \ rS rSrSrS rS rSrg)PingAckReceivediy  a,  
The PingAckReceived event is fired whenever a PING acknowledgment is
received. It contains the 'opaque data' of the PING+ACK frame, allowing the
user to correlate PINGs and calculate RTT.

.. versionadded:: 3.1.0

.. versionchanged:: 4.0.0
   Removed deprecated but equivalent ``PingAcknowledged``.
c                     S U l         g r   r   r   s    r   r   PingAckReceived.__init__  r   r   c                 6    S[        U R                  5      < S3$ )Nz<PingAckReceived ping_data:r$   r   r   s    r   r&   PingAckReceived.__repr__  r   r   r   Nr*   r	   r   r   r   r   y  s    	
r   r   c                   $    \ rS rSrSrS rS rSrg)StreamEndedi  z
The StreamEnded event is fired whenever a stream is ended by a remote
party. The stream may not be fully closed if it has not been closed
locally, but no further data or headers should be expected on that stream.
c                     S U l         g r   r   r   s    r   r   StreamEnded.__init__  r   r   c                      SU R                   -  $ )Nz<StreamEnded stream_id:%s>r   r   s    r   r&   StreamEnded.__repr__  s    +dnn<<r   r   Nr*   r	   r   r   r   r     s    
=r   r   c                   $    \ rS rSrSrS rS rSrg)StreamReseti  a{  
The StreamReset event is fired in two situations. The first is when the
remote party forcefully resets the stream. The second is when the remote
party has made a protocol error which only affects a single stream. In this
case, h2 will terminate the stream early and return this event.

.. versionchanged:: 2.0.0
   This event is now fired when h2 automatically resets a stream.
c                 .    S U l         S U l        SU l        g )NTr   
error_coderemote_resetr   s    r   r   StreamReset.__init__  s      !r   c                 \    SU R                   < SU R                  < SU R                  < S3$ )Nz<StreamReset stream_id:z, error_code:z, remote_reset:r$   r   r   s    r   r&   StreamReset.__repr__  s!    NNDOOT->->
 	
r   )r   r   r   Nr*   r	   r   r   r   r     s    	!
r   r   c                   $    \ rS rSrSrS rS rSrg)PushedStreamReceivedi  z
The PushedStreamReceived event is fired whenever a pushed stream has been
received from a remote peer. The event carries on it the new stream ID, the
ID of the parent stream, and the request headers pushed by the remote peer.
c                 .    S U l         S U l        S U l        g r   pushed_stream_idparent_stream_idr   r   s    r   r   PushedStreamReceived.__init__  s     $ !% r   c                 \    SU R                   < SU R                  < SU R                  < S3$ )Nz'<PushedStreamReceived pushed_stream_id:z, parent_stream_id:r#   r$   r   r   s    r   r&   PushedStreamReceived.__repr__  s'     %%%%		
r   )r   r   r   Nr*   r	   r   r   r   r     s    

r   r   c                   $    \ rS rSrSrS rS rSrg)SettingsAcknowledgedi  z
The SettingsAcknowledged event is fired whenever a settings ACK is received
from the remote peer. The event carries on it the settings that were
acknowedged, in the same format as
:class:`h2.events.RemoteSettingsChanged`.
c                     0 U l         g r   rg   r   s    r   r   SettingsAcknowledged.__init__  rj   r   c                 l    SSR                  S U R                  R                  5        5       5      < S3$ )Nz(<SettingsAcknowledged changed_settings:{ry   c              3   6   #    U H  n[        U5      v   M     g 7fr   r{   r}   s     r   r   0SettingsAcknowledged.__repr__.<locals>.<genexpr>  r   r   r   r   r   s    r   r&   SettingsAcknowledged.__repr__  r   r   rg   Nr*   r	   r   r   r   r     s    #
r   r   c                   $    \ rS rSrSrS rS rSrg)PriorityUpdatedi  a
  
The PriorityUpdated event is fired whenever a stream sends updated priority
information. This can occur when the stream is opened, or at any time
during the stream lifetime.

This event is purely advisory, and does not need to be acted on.

.. versionadded:: 2.0.0
c                 <    S U l         S U l        S U l        S U l        g r   r   weight
depends_on	exclusiver   s    r   r   PriorityUpdated.__init__  s$      
 r   c           	      x    SU R                   < SU R                  < SU R                  < SU R                  < S3	$ )Nz<PriorityUpdated stream_id:z	, weight:z, depends_on:z, exclusive:r$   r   r   s    r   r&   PriorityUpdated.__repr__  s*     	
r   )r   r   r   r   Nr*   r	   r   r   r   r     s     	
r   r   c                   $    \ rS rSrSrS rS rSrg)ConnectionTerminatedi  z
The ConnectionTerminated event is fired when a connection is torn down by
the remote peer using a GOAWAY frame. Once received, no further action may
be taken on the connection: a new connection must be established.
c                 .    S U l         S U l        S U l        g r   )r   last_stream_idadditional_datar   s    r   r   ConnectionTerminated.__init__  s     
 #  $r   c           
          SU R                   < SU R                  < S[        U R                  (       a  U R                  S S OS 5      < S3$ )Nz!<ConnectionTerminated error_code:z, last_stream_id:z, additional_data:rY   r$   )r   r   rZ   r   r   s    r   r&   ConnectionTerminated.__repr__  sD     ##%++ (("-157			
r   )r   r   r   Nr*   r	   r   r   r   r     s    
$

r   r   c                   $    \ rS rSrSrS rS rSrg)AlternativeServiceAvailablei,  a  
The AlternativeServiceAvailable event is fired when the remote peer
advertises an `RFC 7838 <https://tools.ietf.org/html/rfc7838>`_ Alternative
Service using an ALTSVC frame.

This event always carries the origin to which the ALTSVC information
applies. That origin is either supplied by the server directly, or inferred
by h2 from the ``:authority`` pseudo-header field that was sent by
the user when initiating a given stream.

This event also carries what RFC 7838 calls the "Alternative Service Field
Value", which is formatted like a HTTP header field and contains the
relevant alternative service information. h2 does not parse or in any
way modify that information: the user is required to do that.

This event can only be fired on the client end of a connection.

.. versionadded:: 2.3.0
c                      S U l         S U l        g r   )originfield_valuer   s    r   r   $AlternativeServiceAvailable.__init__@  s       r   c                     SU R                   R                  SS5      < SU R                  R                  SS5      < S3$ )Nz$<AlternativeServiceAvailable origin:zutf-8ignorez, field_value:r$   )r   decoder   r   s    r   r&   $AlternativeServiceAvailable.__repr__O  s8     ""7H5  '':	
r   )r   r   Nr*   r	   r   r   r   r   ,  s    & 
r   r   c                   $    \ rS rSrSrS rS rSrg)UnknownFrameReceivediX  a  
The UnknownFrameReceived event is fired when the remote peer sends a frame
that h2 does not understand. This occurs primarily when the remote
peer is employing HTTP/2 extensions that h2 doesn't know anything
about.

RFC 7540 requires that HTTP/2 implementations ignore these frames. h2
does so. However, this event is fired to allow implementations to perform
special processing on those frames if needed (e.g. if the implementation
is capable of handling the frame itself).

.. versionadded:: 2.7.0
c                     S U l         g r   framer   s    r   r   UnknownFrameReceived.__init__f  s	    
r   c                     g)Nz<UnknownFrameReceived>r	   r   s    r   r&   UnknownFrameReceived.__repr__j  s    'r   r   Nr*   r	   r   r   r   r   X  s    (r   r   c                 T    U c  g[         R                  " U 5      R                  S5      $ )z
Converts a bytestring into something that is safe to print on all Python
platforms.

This function is relatively expensive, so it should not be called on the
mainline of the code. It's safe to use in things like object repr methods
though.
Nascii)binasciihexlifyr   )rU   s    r   rZ   rZ   n  s(     |D!((11r   )r   r   settingsr   r   r   r   r-   r4   r;   r>   rB   rE   rH   rK   rR   r]   re   r   r   r   r   r   r   r   r   r   r   rZ   r	   r   r   <module>r      s2  	  <	 	%
e %
P%
u %
P'
u '
T	5 		L 		< 	
	L 
		 	(
E (
V&
5 &
R
E 
,0
E 0
f
5 
$
e 
*=% =
% 
6
5 
6
5 
&#
e #
L
5 
B)
% )
X(5 (,2r   