Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2p�j�>����SSKJr SSKrSSKrSSKrSSKrSSKrSSKJr SSK	J3r4 SSKJr SSK
Jr SSKJr /S	QrS5R$"\R&6r\R*R-SS\S
\35r\R*R-SS\S
\35r\"\R*R-SS55r\"\R*R-SS55r\"\R*R-SS55rSSjr\R<"S5r\R<"S5r \RB"SS55r"\RB"SS55r#S Sjr$S!Sjr%S"Sjr&g)#�)�annotationsN)�	Generator)�Callable�)�Headers)�
SecurityError)�version)�SERVER�6USER_AGENT�Request�Responsez{}.{}�WEBSOCKETS_USER_AGENTzPython/z websockets/�WEBSOCKETS_SERVER�WEBSOCKETS_MAX_NUM_HEADERS�128�WEBSOCKETS_MAX_LINE_LENGTH�8192�WEBSOCKETS_MAX_BODY_SIZE�	1_048_576c� �URSS9$)z?7Decode a bytestring for interpolating into an error message.8 9�backslashreplace��errors)�decode)�values �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\websockets/http11.py�dr2s��10�<�<�1�<�2�2�s[-!#$%&\'*+.^_`|~0-9a-zA-Z]+s[\x09\x20-\x7e\x80-\xff]*c�v�\rSrSr%SrS\S'S\S'SrS\S	'\SS11j5r\	SSj5r12SSjrS
rg)r�Nz{13WebSocket handshake request.14 15Attributes:16    path: Request path, including optional query.17    headers: Request headers.18�str�pathr�headersN�Exception | None�19_exceptionc�P�[R"S[5 UR$)NzIRequest.exception is deprecated; use ServerProtocol.handshake_exc instead��warnings�warn�DeprecationWarningr%��selfs r�	exception�Request.exception^s ���
�
�W��	20����rc#�$# �[U5Shv�NnURSS5upEnUS:wa[S[	U535eUS:wa[S	[	U535eURS21S5n[
U5Shv�NnSU;a[S
5eSU;a[US5S:wa[S5eU"Xx5$N�![an[S5UeSnAff=f![a [S[	U535Sef=fN�7f)a)22Parse a WebSocket handshake request.23 24This is a generator-based coroutine.25 26The request path isn't URL-decoded or validated in any way.27 28The request path and headers are expected to contain only ASCII29characters. Other characters are represented with surrogate escapes.30 31:meth:`parse` doesn't attempt to read the request body because32WebSocket handshake requests don't have one. If the request contains a33body, it may be read from the data stream after :meth:`parse` returns.34 35Args:36    read_line: Generator-based coroutine that reads a LF-terminated37        line or raises an exception if there isn't enough data38 39Raises:40    EOFError: If the connection is closed without a full HTTP request.41    SecurityError: If the request exceeds a security limit.42    ValueError: If the request isn't well formatted.43 44Nz1connection closed while reading HTTP request line� �zinvalid HTTP request line: �HTTP/1.1�)unsupported protocol; expected HTTP/1.1: sGETz+unsupported HTTP method; expected GET; got �ascii�surrogateescape�Transfer-Encodingz!transfer codings aren't supported�Content-Lengthrzunsupported request body)	�45parse_line�EOFError�split�46ValueErrorrr�
parse_headers�NotImplementedError�int)	�cls�	read_line�request_line�exc�method�raw_path�protocolr"r#s	         r�parse�
Request.parsefs=���F	Y�&0��&;�;�L�	X�)5�);�);�D�!�)D�&�F�h��{�"��;�A�l�O�;L�M��
��V���J�1�V�9�+�V�W�W����w�(9�:��*�9�5�5���'�)�%�&I�J�J��w�&��7�+�,�-��2� �!;�<�<��4�!�!�;<���	Y��N�O�UX�X��	Y��47�	X��:�1�\�?�:K�L�M�SW�W�	X��6�sV�D�C48�C�C49�C(�AD�D�AD�C50�51 52C%�C � C%�%D�(#D�Dc�z�SURS3R5nXRR5-
nU$)z+53Serialize a WebSocket handshake request.54 55zGET z HTTP/1.1
56)r"�encoder#�	serialize)r,�requests  rrJ�Request.serialize�s9�������=�1�8�8�:���<�<�)�)�+�+���r���returnr$)r@�9Callable[[int], Generator[None, None, bytes | bytearray]]rOzGenerator[None, None, Request]�rO�bytes)
�__name__�57__module__�__qualname__�__firstlineno__�__doc__�__annotations__r%�propertyr-�classmethodrFrJ�__static_attributes__rMrrrrNsc����I�
��$(�J� �'�
�����@"�L�@"�58(�@"��@"�D	rrc��\rSrSr%SrS\S'S\S'S\S'S	rS59\S'SrS
\S'\SSj5r	\60SSSjj5rSSjrSr
g)r
�z�61WebSocket handshake response.62 63Attributes:64    status_code: Response code.65    reason_phrase: Response reason.66    headers: Response headers.67    body: Response body.68 69r>�status_coder!�
reason_phraserr#r�bytes | bytearray�bodyNr$r%c�P�[R"S[5 UR$)NzJResponse.exception is deprecated; use ClientProtocol.handshake_exc insteadr'r+s rr-�Response.exception�s"���
�
�
7��	70�71���rc#�$# �[U5Shv�NnURSS5upxn	U(aUS;a[S[	U535eOUS:wa[S	[	U535e[U5n72SU73s=::aS:dO [S
[	U535e[RU	5(d[S[	U	535eU	RSS5n[U5Shv�NnU(aSn
O[X�XU5Shv�Nn
U"X�X�5$GN
![an[S5UeSnAff=f![a [S[	U535Sef=f![a [S74[	U535Sef=fN�N|7f)a:75Parse a WebSocket handshake response.76 77This is a generator-based coroutine.78 79The reason phrase and headers are expected to contain only ASCII80characters. Other characters are represented with surrogate escapes.81 82Args:83    read_line: Generator-based coroutine that reads a LF-terminated84        line or raises an exception if there isn't enough data.85    read_exact: Generator-based coroutine that reads the requested86        bytes or raises an exception if there isn't enough data.87    read_to_eof: Generator-based coroutine that reads until the end88        of the stream.89 90Raises:91    EOFError: If the connection is closed without a full HTTP response.92    SecurityError: If the response exceeds a security limit.93    LookupError: If the response isn't well formatted.94    ValueError: If the response isn't well formatted.95 96Nz0connection closed while reading HTTP status liner0r1zinvalid HTTP status line: )r2sHTTP/1.0z5unsupported protocol; expected HTTP/1.1 or HTTP/1.0: r2r3z+invalid status code; expected integer; got �diXu-invalid status code; expected 100–599; got zinvalid HTTP reason phrase: r4r5r)r8r9r:r;rr>�	_value_re�	fullmatchrr<�	read_body)r?r@�97read_exact�read_to_eof�proxy�status_linerBrE�raw_status_code�98raw_reasonr^�reasonr#ras              rrF�Response.parse�s����B	X�%/�	�%:�:�K�	V�4?�4E�4E�d�A�4N�1�H�z���9�9� �K���~�&�(���:��;�&� �?��+��?O�P���	��o�.�K�99�k�'�C�'��?��/�@R�?S�T��
��"�"�:�.�.��;�A�j�M�?�K�L�L��"�"�7�,=�>��*�9�5�5����D�'��i�[���D��;��6�6�W;���	X��M�N�TW�W��	X��100�	V��9�!�K�.�9I�J�K�QU�U�	V���	��=�a��>P�=Q�R���
�	��6��s��F�D"�D�D"�E�AF�0E&�;A7F�2F�3F�F�
F�D"�"101D=�,D8�8D=�=F�#E#�#F�&#F	�	F�Fc��SURSURS3R5nXRR	5-
nXR102-
nU$)z,103Serialize a WebSocket handshake response.104 105z	HTTP/1.1 � z
106)r^r_rIr#rJra)r,�responses  rrJ�Response.serialize!sU���t�/�/�0��$�2D�2D�1E�T�J�Q�Q�S���L�L�*�*�,�,���I�I����rrMrN)F)107r@rPrirPrjrPrk�boolrOzGenerator[None, None, Response]rQ)rSrTrUrVrWrXrar%rYr-rZrFrJr[rMrrr
r
�s���	�����
��!�D�108�!�#'�J� �'�
������L7�L�L7�N�L7�O�	L7�109�L7�110)�
L7��L7�\111rr
c#�# �U"[5Shv�NnURS5(d[	S5eUSS$N*![a [S5ef=f7f)aK112Parse a single line.113 114CRLF is stripped from the return value.115 116Args:117    read_line: Generator-based coroutine that reads a LF-terminated line118        or raises an exception if there isn't enough data.119 120Raises:121    EOFError: If the connection is closed without a CRLF.122    SecurityError: If the response exceeds a security limit.123 124Nz
line too long�
125zline without CRLF�����)�MAX_LINE_LENGTH�RuntimeErrorr�endswithr9)r@�lines  rr8r8.s^���"-�#�O�4�4���=�=��!�!��*�+�+����9��
5���-��O�,�,�-�s)�A�A�>�A�&A�A�A�Ac#�# �[5n[[S-5H�n[U5Shv�NnUS:Xa U$URSS5upV[RU5(d[
S[U535eURS5n[RU5(d[
S	[U535eURS1265nURS127S5nX�U'M� [S5eN�![an[	S5UeSnAff=f![a [
S[U535Sef=f7f)
a�128Parse HTTP headers.129 130Non-ASCII characters are represented with surrogate escapes.131 132Args:133    read_line: Generator-based coroutine that reads a LF-terminated line134        or raises an exception if there isn't enough data.135 136Raises:137    EOFError: If the connection is closed without complete headers.138    SecurityError: If the request exceeds a security limit.139    ValueError: If the request isn't well formatted.140 141rNz,connection closed while reading HTTP headersr�:zinvalid HTTP header line: zinvalid HTTP header name: s 	zinvalid HTTP header value: r4r5ztoo many HTTP headers)r�range�MAX_NUM_HEADERSr8r9r:r;r�	_token_rerg�striprfrr)	r@r#�_r|rB�raw_name�	raw_value�namers	         rr<r<IsG���,�i�G�
�?�Q�&�
'��	T�(��3�3�D��3�;��&�N�#	O�"&�*�*�T�1�"5��H��"�"�8�,�,��9�!�H�+��G�H�H��O�O�F�+�	��"�"�9�-�-��:�1�Y�<�.�I�J�J����w�'��� � ��*;�<����
�)(�.�3�4�4�+4���	T��I�J�PS�S��	T���	O��9�!�D�'��C�D�$�N�	O�sP� E�C?�C=�C?�	E�D�B)E�=C?�?142D�	D�D�E�#E�Ec#�# �SUs=::aS:dO US:XdUS:XagURS5=nb�US:wa[SUS	35eSn[U5Shv�NnURS143S5Sn[	U5S
:�aURSS9n	[
SU	S35e[US5n144U145S:XaOd[	U5U146-[:�a[
SU147S[	U5S35eXc"U1485Shv�N-
nU"S5Shv�NS:wa[S5eM�[U5Shv�N U$URS5=nbR[	U5S:�a[
SUS35e[U5nU[:�a[
SUS35eU"U5Shv�N$U"[5Shv�N$GNNN�N�N�N"N![a [
S[S35ef=f7f)Nre����i0rr6�chunkedztransfer coding z isn't supported�;rr�rrzchunk too large: 0xz bytes�zchunk too large: z
 bytes after r1rwzchunk without CRLFr7�zbody too large: zbody too large: over )�getr=r8r:�lenrrr>�
MAX_BODY_SIZEr;r<rz)
r^r#r@rirj�codingra�chunk_size_line�raw_chunk_size�str_chunk_size�149chunk_size�raw_content_length�content_lengths
             rrhrh|s����k��C��;�#�#5���9K���K�K� 3�4�1504�&�	A��Y��%�(8���@P�&Q�R�R����)3�I�)>�>�O�,�2�2�4��;�A�>�N��>�"�R�'�!/�!6�!6�>P�!6�!Q��#�&9�.�9I��$P�Q�Q��^�R�0�J��Q����4�y�:�%�
�5�#�'�151�|�=��T���6�R���
�z�*�5�5�5�D�%�a�=�(�W�4� �!5�6�6�!�$!��+�+�+��� '���,<� =�152=�153�	J��!�"�R�'��"2�3E�2F�f� M�N�N��/�0���M�)��"2�>�2B�&� I�J�J�%�n�5�5�6�	O�*�=�9�9�:�??�6�(�	,�6�:���	O��"7�
��f� M�N�N�	O�s��AG�F'�BG�/F*�0G�F,�#G�%F.�&A'G�
F0�G�F4�"F2�#F4�&G�*G�,G�.G�0G�2F4�4G�G)rr`rOr!)r@rPrO�(Generator[None, None, bytes | bytearray])r@rPrOzGenerator[None, None, Headers])r^r>r#rr@rPrirPrjrPrOr�)'�154__future__r�dataclasses�os�re�sysr(�collections.abcr�typingr�datastructuresr�155exceptionsrr	�websockets_version�__all__�format�version_info�PYTHON_VERSION�environr�rr156r>r�ryr�r�compiler�rf�	dataclassrr
r8r<rhrMrr�<module>r�s���"��	�	�157��%��#�%�2�������!1�!1�2���Z�Z�^�^��
�n�
�\�*<�)=�>��158�159������
�n�
�\�*<�)=�>�160���b�j�j�n�n�%A�5�I�J���b�j�j�n�n�%A�6�J�K���B�J�J�N�N�#=�{�K�L�
�3�
�J�J�7�8�	�
�J�J�4�5�	�
���c�c��c�L
���u�u��u�p�H��-��60�H�0�#�0�f:O��:O�
�:O�I�:O�J�	:O�161K�:O�.�
:Or
codekingpro/portable-devtools · Team Ai