Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2��j#0����SrSSKJr SSKrSSKrSSKJrJr SSKJ	r	 SSK3Jr SSKJ
r
 SS	KJr "S4S\R 5rSSjr"S
S5r"SS\\	\\4\45rSSjrg)a5h2/settings6~~~~~~~~~~~7 8This module contains a HTTP/2 settings object. This object provides a simple9API for manipulating HTTP/2 settings, keeping track of both the current active10state of the settings and the unacknowledged future values of the settings.11�)�annotationsN)�Iterator�MutableMapping)�Union)�
SettingsFrame�)�12ErrorCodes)�InvalidSettingsValueErrorc���\rSrSrSr\Rr\Rr\Rr\Rr	\Rr13\Rr\RrSr
g)�SettingCodes�z:14All known HTTP/2 setting codes.15 16.. versionadded:: 2.6.017�N)�__name__�18__module__�__qualname__�__firstlineno__�__doc__r�HEADER_TABLE_SIZE�ENABLE_PUSH�MAX_CONCURRENT_STREAMS�INITIAL_WINDOW_SIZE�MAX_FRAME_SIZE�MAX_HEADER_LIST_SIZE�ENABLE_CONNECT_PROTOCOL�__static_attributes__r��QD:\code\apps\devtools\python\user_packages\Python313\site-packages\h2/settings.pyrrsg���&�7�7�� �+�+�K�+�A�A��(�;�;��#�1�1�N�)�=�=��,�C�C�rrc�>�[U5$![a Us$f=f)z�19Given an integer setting code, returns either one of :class:`SettingCodes20<h2.settings.SettingCodes>` or, if not present in the known set of codes,21returns the integer directly.22)r�23ValueError)�codes r�_setting_code_from_intr!<s&����D�!�!�������s�24
��c�(�\rSrSrSSjrSSjrSrg)�ChangedSetting�Hc�(�XlX lX0lg�N��setting�original_value�	new_value)�selfr(r)r*s    r�__init__�ChangedSetting.__init__Js��25��-��#�rc�X�SUR<SURSURS3$)NzChangedSetting(setting=z, original_value=z, new_value=�)r'�r+s r�__repr__�ChangedSetting.__repr__Ws6��%�d�l�l�%5�5F�t�GZ�GZ�F[�[g�hl�hv�hv�gw�wx�y�	26r)r*r)r(N)r(�SettingCodes | intr)�27int | Noner*�int�return�None)r6�str)rrrrr,r1rrrrr#r#Hs��#�28rr#c��\rSrSrSrSSSjjrSSjr\SSj5r\RS Sj5r\SSj5r29\30RS S	j5r31\SS32j5r\RS Sj5r\SSj5r\RS S
j5r\SSj5r
\
RS Sj5r
\S!Sj5r\RS Sj5r\SSj5r\RS Sj5rS"SjrS#SjrS$SjrS%SjrSSjrS&SjrS&SjrSrg)'�Settings�]a33An object that encapsulates HTTP/2 settings state.34 35HTTP/2 Settings are a complex beast. Each party, remote and local, has its36own settings and a view of the other party's settings. When a settings37frame is emitted by a peer it cannot assume that the new settings values38are in place until the remote peer acknowledges the setting. In principle,39multiple settings changes can be "in flight" at the same time, all with40different values.41 42This object encapsulates this mess. It provides a dict-like interface to43settings, which return the *current* values of the settings in question.44Additionally, it keeps track of the stack of proposed values: each time an45acknowledgement is sent/received, it updates the current values with the46stack of proposed values. On top of all that, it validates the values to47make sure they're allowed, and raises :class:`InvalidSettingsValueError48<h2.exceptions.InvalidSettingsValueError>` if they are not.49 50Finally, this object understands what the default values of the HTTP/251settings are, and sets those defaults appropriately.52 53.. versionchanged:: 2.2.054   Added the ``initial_values`` parameter.55 56.. versionchanged:: 2.5.057   Added the ``max_header_list_size`` property.58 59:param client: (optional) Whether these settings should be defaulted for a60    client implementation or a server implementation. Defaults to ``True``.61:type client: ``bool``62:param initial_values: (optional) Any initial values the user would like63    set, rather than RFC 7540's defaults.64:type initial_vales: ``MutableMapping``65Nc�`�[R[R"S/5[R[R"[U5/5[R[R"S/5[R[R"S/5[R[R"S/50Ul	UbbUR5HMup4[X45nU(aSUSU3n[UUS9e[R"U/5URU'MO gg)Nii���@r�Setting � has invalid value ��66error_code)
rr�collections�dequerr5rrr�	_settings�items�_validate_settingr67)r+�client�initial_values�key�value�invalid�msgs       rr,�Settings.__init__�s���
�*�*�K�,=�,=�t�f�,E��$�$�k�&7�&7��V��
�&F��,�,�k�.?�.?���.H��'�'��):�):�E�7�)C��0�0�+�2C�2C�Q�C�2H�L68����%�,�2�2�4�69��+�C�7���$�S�E�)<�U�G�D�C�3��#*���'2�&7�&7���&@����s�#�5�&rc��0nURR5H9up#[U5S:�dMUR5nUSn[	X$U5X'M; U$)z�70The settings have been acknowledged, either by the user (remote71settings) or by the remote peer (local settings).72 73:returns: A dict of {setting: ChangedSetting} that were applied.74rr)rDrE�len�popleftr#)r+�changed_settings�k�v�old_setting�new_settings      r�acknowledge�Settings.acknowledge�sa��FH���N�N�(�(�*�D�A��1�v��z��i�i�k����d��&4��K�'� �#�	+� �rc�(�U[R$)zj75The current value of the :data:`HEADER_TABLE_SIZE76<h2.settings.SettingCodes.HEADER_TABLE_SIZE>` setting.77�rrr0s r�header_table_size�Settings.header_table_size�s���L�2�2�3�3rc�(�X[R'gr&rY�r+rJs  rrZr[�s��/4�\�
+�
+�,rc�(�U[R$)z^78The current value of the :data:`ENABLE_PUSH79<h2.settings.SettingCodes.ENABLE_PUSH>` setting.80�rrr0s r�enable_push�Settings.enable_push�s���L�,�,�-�-rc�(�X[R'gr&r_r]s  rr`ra�s��).�\�
%�
%�&rc�(�U[R$)zn81The current value of the :data:`INITIAL_WINDOW_SIZE82<h2.settings.SettingCodes.INITIAL_WINDOW_SIZE>` setting.83�rrr0s r�initial_window_size�Settings.initial_window_size�s���L�4�4�5�5rc�(�X[R'gr&rdr]s  rrerf�s��16�\�
-�
-�.rc�(�U[R$)zd84The current value of the :data:`MAX_FRAME_SIZE85<h2.settings.SettingCodes.MAX_FRAME_SIZE>` setting.86�rrr0s r�max_frame_size�Settings.max_frame_size�s���L�/�/�0�0rc�(�X[R'gr&rir]s  rrjrk�s��,1�\�
(�
(�)rc�B�UR[RS5$)zt87The current value of the :data:`MAX_CONCURRENT_STREAMS88<h2.settings.SettingCodes.MAX_CONCURRENT_STREAMS>` setting.89l)�getrrr0s r�max_concurrent_streams�Settings.max_concurrent_streams�s���x�x��;�;�W�E�Erc�(�X[R'gr&)rrr]s  rrorp�s��49�\�
0�
0�1rc�B�UR[RS5$)z�90The current value of the :data:`MAX_HEADER_LIST_SIZE91<h2.settings.SettingCodes.MAX_HEADER_LIST_SIZE>` setting. If not set,92returns ``None``, which means unlimited.93 94.. versionadded:: 2.5.095N)rnrrr0s r�max_header_list_size�Settings.max_header_list_size�s���x�x��9�9�4�@�@rc�(�X[R'gr&)rrr]s  rrsrt�s��27�\�
.�
.�/rc�(�U[R$)zv96The current value of the :data:`ENABLE_CONNECT_PROTOCOL97<h2.settings.SettingCodes.ENABLE_CONNECT_PROTOCOL>` setting.98�rrr0s r�enable_connect_protocol� Settings.enable_connect_protocol�s���L�8�8�9�9rc�(�X[R'gr&rwr]s  rrxrys��5:�\�
1�
1�2rc�<�URUSnUc[eU$)Nr)rD�KeyError)r+rI�vals   r�__getitem__�Settings.__getitem__s&���n�n�S�!�!�$���;��N��99rc���[X5nU(aSUSU3n[UUS9eURUnUR
U5 g![a( [R100"S/5nXPRU'NCf=f)Nr>r?r@)rFr101rDr|rBrC�append)r+rIrJrKrLrEs      r�__setitem__�Settings.__setitem__s���#�C�/����S�E�!4�U�G�<�C�+��"��
�102	(��N�N�3�'�E�103	���U���	�	(��%�%�t�f�-�E�"'�N�N�3��	(�s�A�/A9�8A9c��URU	gr&�rD)r+rIs  r�__delitem__�Settings.__delitem__#s���N�N�3�rc�6�URR5$r&)rD�__iter__r0s rr��Settings.__iter__&s���~�~�&�&�(�(rc�,�[UR5$r&)rOrDr0s r�__len__�Settings.__len__)s���4�>�>�"�"rc�j�[U[5(aURUR:H$[$r&)�104isinstancer:rD�NotImplemented�r+�others  r�__eq__�Settings.__eq__,s(���e�X�&�&��>�>�U�_�_�4�4��rc�B�[U[5(aX:X+$[$r&)r�r:r�r�s  r�__ne__�Settings.__ne__1s���e�X�&�&��$�$��rr�)TN)rG�boolrHzdict[SettingCodes, int] | Noner6r7)r6z(dict[SettingCodes | int, ChangedSetting])r6r5)rJr5r6r7)r6r4)rIr3r6r5)rIr3rJr5r6r7)rIr3r6r7)r6zIterator[SettingCodes | int])r��objectr6r�)rrrrrr,rV�propertyrZ�setterr`rerjrorsrxr~r�r�r�r�r�r�rrrrr:r:]s|��!�FA�2 �,�4��4����5��5��.��.����/��/��6��6����7� �7��1��1����2��2��F��F��"�"�:�#�:��A��A�� � �8�!�8��:��:��#�#�;�$�;���" �)�#��105rr:c��U[R:Xa'US;a[R$[R$U[R:Xa@SUs=::aS::d"[R106$ [R107$[R$U[R:Xa@SUs=::aS::d"[R$ [R$[R$U[R:Xa'US:a[R$[R$U[R:XaUS;a[R$[R$)z�108Confirms that a specific setting has a well-formed value. If the setting is109invalid, returns an error code. Otherwise, returns 0 (NO_ERROR).110)rrri���r=i���)111rrr	�PROTOCOL_ERRORr�FLOW_CONTROL_ERRORrrr�NO_ERROR)r(rJs  rrFrF7s8��112�,�*�*�*�����,�,�,������113�L�4�4�	4��E�'�Z�'��0�0�0�(��0�0�0�(�����114�L�/�/�	/���)��)��,�,�,�*��,�,�,�*�����
115�L�5�5�	5��1�9��,�,�,��116����117�L�8�8�	8�U�&�=P��(�(�(����r)r r5r6r3)r(r3rJr5r6r	)r�118__future__rrB�enum�collections.abcrr�typingr�hyperframe.framer�errorsr	�119exceptionsr120�IntEnumrr!r#r5r:rFrrr�<module>r�sn���#���4��*��1�#D�4�<�<�#D�L	�121�122�*W�~�e�L�#�$5�6��;�<�W�tr
codekingpro/portable-devtools · Team Ai