Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
events.cpython-313.pyc215 linesDownload Raw Back to __pycache__
1�

2��j���P�SrSSKJr SSKJr SSKJrJr SSKJ	r	J3r4Jr \	(aSSKJ
r
 SSKJr SS	KJr "S5S\5r\"SS
9"SS\55r\"SS
9"SS\55r\"SS
9"SS\55r\"SS
9"SS\55r\"SS
9"SS\55r\"S\\-\5r\"SS
9"SS\\6\55r\"SS
9"SS\\55r\"SS
9"SS\\\-55r\"SS
9"SS \55r\"SS
9"S!S"\55rg#)$zc7wsproto/events8~~~~~~~~~~~~~~9 10Events that result from processing data on a WebSocket connection.11�)�annotations)�ABC)�	dataclass�field)�
TYPE_CHECKING�Generic�TypeVar)�Sequence�)�	Extension)�Headersc��\rSrSrSrSrg)�Event�z 12Base class for wsproto events.13�N��__name__�14__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r��TD:\code\apps\devtools\python\user_packages\Python313\site-packages\wsproto/events.pyrrs���	rrT)�frozenc�p�\rSrSr%SrS\S'S\S'\"\S9rS\S'\"\S9r	S	\S15'\"\S9r16S\S'S
rg)�Request�a�17The beginning of a Websocket connection, the HTTP Upgrade request18 19This event is fired when a SERVER connection receives a WebSocket20handshake request (HTTP with upgrade header).21 22Fields:23 24.. attribute:: host25 26   (Required) The hostname, or host header value.27 28.. attribute:: target29 30   (Required) The request target (path and query string)31 32.. attribute:: extensions33 34   The proposed extensions.35 36.. attribute:: extra_headers37 38   The additional request headers, excluding extensions, host, subprotocols,39   and version headers.40 41.. attribute:: subprotocols42 43   A list of the subprotocols proposed in the request, as a list44   of strings.45�str�host�target��default_factoryz#Sequence[Extension] | Sequence[str]�46extensionsr
�
extra_headersz	list[str]�subprotocolsrN)rrrrr�__annotations__r�listr$r%r&rrrrrrsA���>�I��K�6;�D�6Q�J�3�Q�"�4�8�M�7�8�#�D�9�L�)�9rrc�T�\rSrSr%SrSrS\S'\"\S9r	S\S'\"\S9r47S	\S48'Srg)�AcceptConnection�Ea�49The acceptance of a Websocket upgrade request.50 51This event is fired when a CLIENT receives an acceptance response52from a server. It is also used to accept an upgrade request when53acting as a SERVER.54 55Fields:56 57.. attribute:: extra_headers58 59   Any additional (non websocket related) headers present in the60   acceptance response.61 62.. attribute:: subprotocol63 64   The accepted subprotocol to use.65 66N�67str | None�subprotocolr"zlist[Extension]r$r
r%r)rrrrrr-r'rr(r$r%rrrrr*r*Es1���(#�K��"�"'��"=�J��=�"�4�8�M�7�8rr*c�L�\rSrSr%SrSrS\S'\"\S9r	S\S'S	r68S69\S'Srg
)�RejectConnection�`aU70The rejection of a Websocket upgrade request, the HTTP response.71 72The ``RejectConnection`` event sends the appropriate HTTP headers to73communicate to the peer that the handshake has been rejected. You may also74send an HTTP body by setting the ``has_body`` attribute to ``True`` and then75sending one or more :class:`RejectData` events after this one. When sending76a response body, the caller should set the ``Content-Length``,77``Content-Type``, and/or ``Transfer-Encoding`` headers as appropriate.78 79When receiving a ``RejectConnection`` event, the ``has_body`` attribute will80in almost all cases be ``True`` (even if the server set it to ``False``) and81will be followed by at least one ``RejectData`` events, even though the data82itself might be just ``b""``. (The only scenario in which the caller83receives a ``RejectConnection`` with ``has_body == False`` is if the peer84violates sends an informational status code (1xx) other than 101.)85 86The ``has_body`` attribute should only be used when receiving the event. (It87has ) is False the headers must include a88content-length or transfer encoding.89 90Fields:91 92.. attribute:: headers (Headers)93 94   The headers to send with the response.95 96.. attribute:: has_body97 98   This defaults to False, but set to True if there is a body. See99   also :class:`~RejectData`.100 101.. attribute:: status_code102 103   The response status code.104 105i��int�status_coder"r
�headersF�bool�has_bodyrN)rrrrrr2r'rr(r3r5rrrrr/r/`s-��$�L�K����T�2�G�W�2��H�d�rr/c�2�\rSrSr%SrS\S'SrS\S'Srg	)106�107RejectData�aB108The rejection HTTP response body.109 110The caller may send multiple ``RejectData`` events. The final event should111have the ``body_finished`` attribute set to ``True``.112 113Fields:114 115.. attribute:: body_finished116 117   True if this is the final chunk of the body data.118 119.. attribute:: data (bytes)120 121   (Required) The raw body data.122 123�bytes�dataTr4�
body_finishedrN)rrrrrr'r;rrrrr7r7�s���$�K��M�4�rr7c�<�\rSrSr%SrS\S'SrS\S'S124SjrS	rg)�CloseConnection�aj125The end of a Websocket connection, represents a closure frame.126 127**wsproto does not automatically send a response to a close event.** To128comply with the RFC you MUST send a close event back to the remote WebSocket129if you have not already sent one. The :meth:`response` method provides a130suitable event for this purpose, and you should check if a response needs131to be sent by checking :func:`wsproto.WSConnection.state`.132 133Fields:134 135.. attribute:: code136 137   (Required) The integer close code to indicate why the connection138   has closed.139 140.. attribute:: reason141 142   Additional reasoning for why the connection has closed.143 144r1�codeNr,�reasonc�>�[URURS9$)z?Generate an RFC-compliant close frame to send back to the peer.)r?r@)r=r?r@��selfs r�response�CloseConnection.response�s���D�I�I�d�k�k�B�Brr)�returnr=)	rrrrrr'r@rDrrrrr=r=�s���,�I��F�J��Crr=�Tc�@�\rSrSr%SrS\S'SrS\S'SrS\S'S	rg145)�Message��a�146The websocket data message.147 148Fields:149 150.. attribute:: data151 152   (Required) The message data as byte string, can be decoded as UTF-8 for153   TEXT messages.  This only represents a single chunk of data and154   not a full WebSocket message.  You need to buffer and155   reassemble these chunks to get the full message.156 157.. attribute:: frame_finished158 159   This has no semantic content, but is provided just in case some160   weird edge case user wants to be able to reconstruct the161   fragmentation pattern of the original stream.162 163.. attribute:: message_finished164 165   True if this frame is the last one of this message, False if166   more frames are expected.167 168rGr:Tr4�frame_finished�message_finishedrN)	rrrrrr'rKrLrrrrrIrI�s#���2�G��N�D��!��d�!rrIc��\rSrSrSrSrg)�TextMessage��a169Fired when a data frame with TEXT payload is received.170 171Fields:172 173.. attribute:: data174 175   The message data as string, This only represents a single chunk176   of data and not a full WebSocket message.  You need to buffer177   and reassemble these chunks to get the full message.178rNrrrrrNrN�s��179rrNc��\rSrSrSrSrg)�BytesMessage��aR180Fired when a data frame with BINARY payload is received.181 182Fields:183 184.. attribute:: data185 186   The message data as bytes or a bytearray, can be decoded as UTF-8 for187   TEXT messages.  This only represents a single chunk of data and188   not a full WebSocket message.  You need to buffer and189   reassemble these chunks to get the full message.190rNrrrrrQrQ�s��rrQc�2�\rSrSr%SrSrS\S'S	SjrSrg)191�Pingi	a�192The Ping event can be sent to trigger a ping frame and is fired193when a Ping is received.194 195**wsproto does not automatically send a pong response to a ping event.** To196comply with the RFC you MUST send a pong even as soon as is practical. The197:meth:`response` method provides a suitable event for this purpose.198 199Fields:200 201.. attribute:: payload202 203   An optional payload to emit with the ping frame.204rr9�payloadc�(�[URS9$)z>Generate an RFC-compliant :class:`Pong` response to this ping.)rU)�PongrUrBs rrD�
Ping.responses���D�L�L�)�)rrN)rFrW)	rrrrrrUr'rDrrrrrTrT	s��
��G�U��*rrTc�(�\rSrSr%SrSrS\S'Srg)rWi!z�205The Pong event is fired when a Pong is received.206 207Fields:208 209.. attribute:: payload210 211   An optional payload to emit with the pong frame.212 213rr9rUrN)rrrrrrUr'rrrrrWrW!s��	��G�U�rrWN) r�214__future__r�abcr�dataclassesrr�typingrrr	�collections.abcr215r$rr
rrr*r/r7r=r9�	bytearrayrrGrIrNrQrTrWrrr�<module>r`s����#��(�2�2��(�%��	�C�	��$��$:�e�$:��$:�N�$��9�u�9��9�4�$��)�u�)��)�X�$�������.�$��C�e�C��C�>�C���"�C�(���$��"�e�W�Q�Z�"��"�>�$���'�#�,�����$����I�������"�$��*�5�*��*�.�$���5���r
codekingpro/portable-devtools · Team Ai