Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
commands.cpython-313.pyc61 linesDownload Raw Back to __pycache__
1�

2��j���T�SrSSKrSSKrSSKJr SSKJr SSKrSSKJ	r	 SSKJ3r4 \(aSSKr"SS5r"S	S5\5r
"SS\5r"S
S\5r"SS\5r"SS\5r"SS\5r"SS\\R&R(5r"SS\5rg)a&6Commands make it possible for layers to communicate with the "outer world",7e.g. to perform IO or to ask the master.8A command is issued by a proxy layer and is then passed upwards to the proxy server, and from there9possibly to the master and addons.10 11The counterpart to commands are events.12�N)�
TYPE_CHECKING)�Union)�13Connection)�Serverc�:�\rSrSr%SrSr\\S4\S'Sr	Sr14g)	�Command�z15Base class for all commands16Fzmitmproxy.proxy.layer.Layer�blockingc��URR5nURSS5 [U5RSU<S3$)Nr17�(�))�__dict__�copy�pop�type�__name__)�self�xs  �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/proxy/commands.py�__repr__�Command.__repr__)s@���M�M��� ��	���j�$���t�*�%�%�&�a��u�A�.�.��N)r�18__module__�__qualname__�__firstlineno__�__doc__r19r�bool�__annotations__r�__static_attributes__rrrrrs)���<A�H�e�D�7�7�8�@�20�/rrc�2�\rSrSr%Sr\\S'S\4SjrSrg)�
RequestWakeup�/zA21Request a `Wakeup` event after the specified amount of seconds.22�delayc��Xlg�N�r$)rr$s  r�__init__�RequestWakeup.__init__6s���23rr'N)	rrrrr�floatrr(r rrrr"r"/s����L��e�rr"c�2�\rSrSr%Sr\\S'S\4SjrSrg)�ConnectionCommand�:z*24Commands involving a specific connection25�26connectionc��Xlgr&�r.)rr.s  rr(�ConnectionCommand.__init__As��$�rr0N)	rrrrrrrr(r rrrr,r,:s�����%�:�%rr,c�J^�\rSrSr%Sr\\S'S\S\4U4SjjrSr	Sr27U=r$)�SendData�Ez28Send data to a remote peer29�datar.c�0>�[TU]U5 X lgr&)�superr(r5)rr.r5�	__class__s   �rr(�SendData.__init__Ls���
����$��	rc��[UR5RSS5SR5nSUSUR<S3$)Nr�rz	SendData(�, r
)�strr.�split�lowerr5)r�targets  rr�SendData.__repr__PsD���T�_�_�%�+�+�C��3�A�6�<�<�>���6�(�"�T�Y�Y�M��3�3r)r5)rrrrr�bytesrrr(rr �
__classcell__�r8s@rr3r3Es,�����K��:��U��4�4rr3c�(�\rSrSr%Sr\\S'SrSrg)�OpenConnection�Uz30Open a new connection31r.TrN)	rrrrrrrr32r rrrrFrFUs������HrrFc��\rSrSrSrSrg)�CloseConnection�^zy33Close a connection. If the client connection is closed,34all other connections will ultimately be closed during cleanup.35rN)rrrrrr rrrrIrI^s��rrIc�F^�\rSrSr%\\S'SS\S\4U4SjjjrSrU=r	$)�CloseTcpConnection�e�36half_closer.c�0>�[TU]U5 X lgr&)r7r(rN)rr.rNr8s   �rr(�CloseTcpConnection.__init__ms���
����$�$�r)rN)F)37rrrrrrrr(r rCrDs@rrLrLes&������%�:�%�4�%�%rrLc�4^�\rSrSrSrSrSrU4SjrSrU=r	$)�	StartHook�rz}38Start an event hook in the mitmproxy core.39This triggers a particular function (derived from the class name) in all addons.40�Tc�T>�U[La[S5e[TU]"U/UQ70UD6$)Nz+StartHook may not be instantiated directly.)rR�	TypeErrorr7�__new__)�cls�args�kwargsr8s   �rrW�StartHook.__new__{s0����)���I�J�J��w��s�4�T�4�V�4�4rr)41rrrrr�namer42rWr rCrDs@rrRrRrs����43�D��H�5�5rrRc�`�\rSrSr%Sr\\S'\\S'\R4S\S\4Sjjr44SrSrg)	�Log�a�45Log a message.46 47Layers could technically call `logging.log` directly, but the use of a command allows us to48write more expressive playbook tests. Put differently, by using commands we can assert that49a specific log message is a direct consequence of a particular I/O event.50This could also be implemented with some more playbook magic in the future,51but for now we keep the current approach as the fully sans-io one.52�message�levelc��[U[5(a8[R"S[SS9 [[UR55nXlX l	g)Nz>commands.Log() now expects an integer log level, not a string.�)�53stacklevel)54�55isinstancer=�warnings�warn�DeprecationWarning�getattr�logging�upperr`ra)rr`ras   rr(�Log.__init__�sD��56�e�S�!�!��M�M�P�"��
�57�G�U�[�[�]�3�E����58rc��SUR<S[R"UR5R	5S3$)NzLog(r<r
)r`rj�getLevelNamerar?)rs rr�Log.__repr__�s6���d�l�l�%�R��(<�(<�T�Z�Z�(H�(N�(N�(P�'Q�QR�S�Sr)rar`N)
rrrrrr=r�intrj�INFOr(rr rrrr^r^�s9����L��J�59�\�\�
��
��
�Trr^)rrjrf�typingrr�mitmproxy.hooks�	mitmproxy�mitmproxy.connectionrr�mitmproxy.proxy.layerrr"r,r3rFrIrL�hooks�HookrRr^rrr�<module>rys������ ���+�'�� �/�/�0�G��%��%�
4� �
4� �&���'��60%��61%�5�����-�-�5�T�'�Tr
codekingpro/portable-devtools · Team Ai