403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python315/Lib/test/test_pyrepl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_pyrepl/__pycache__/test_reader.cpython-315.pyc
R
>lqj�Xc
���]PHs]PHs]PHs]QHGs]QHGs]QHGs]QH$G
s
Gs]QH0G
s
Gs]QH0GsGs]QH0GsGs]QHLGs]Q	HTGs]Q
H\GsGs]QHhGs]QHpGsQ
QQQ-s\O>OA2TTt-tFD,vq\OCV]*OE22UaJ.	toos#Qs$\QQ\\22s%\
QQ\\22s&P!ttooh)�)�dedent)�TestCase)�	MagicMock)�force_colorized_test_class�force_not_colorized_test_class)�handle_all_events�handle_events_narrow_console)�ScreenEqualMixin�code_to_events)�prepare_reader�prepare_console)�Event)�	LayoutMap)�ReadlineAlikeReader�ReadlineConfig)�Reader)�
default_theme�reset�z�soft_keyword�Kc�x�[U-U@oU;QUmQUmQUmQUmP
UmP
UmU!)zPython 3.15
>>> zPython 3.15
... �r�
get_prompt�ps1�ps2�ps3�ps4�can_colorize�
paste_mode��args�kwargs�readers*, �1C:\Python315\\Lib\test\test_pyrepl\test_reader.py�prepare_reader_multiline_promptr%sH��
�T�
,�V�
,�F���$�F�J�$�F�J�$�F�J�$�F�J��F���F���M�c�`�\sQs]#snQsQsQsQsQsQs	Qs
QsQ	sQ
s
QsQsQ
sQsQsQsQsQsQsQsQsQsQsQsQsQsQsUsP!)�
TestReaderc��[[U2[Q5vqEUOUOU2UOUO
U2P!)�r)rr
r%�assertEqual�screen�cxy)�self�code�expected_screen�expected_cxyr#�_s&&&&  r$�assert_multiline_prompt_screen�)TestReader.assert_multiline_prompt_screen%sC��%��4� �:�
�	��
	
�������8�������\�2r&c�2�UOQQQ,Q2P!)�abc�Python 3.15z>>> abc)���r3�r.s&r$�6test_multiline_prompt_does_not_duplicate_leading_lines�ATestReader.test_multiline_prompt_does_not_duplicate_leading_lines.s���+�+��
�I�&��	
r&c�2�UOQ,QNQ2P!)zif x:
    y)r7z	>>> if x:r7z
...         y)�
�r:r;s&r$�Jtest_multiline_prompt_does_not_duplicate_leading_lines_across_buffer_lines�UTestReader.test_multiline_prompt_does_not_duplicate_leading_lines_across_buffer_lines5s���+�+��
�
�		
r&c�b�[Q2o[U2vq#UOUQQ02P!)�
�\
a�
aaaaaaaaaa�	aaaaaaaaa�r
r�assert_screen_equal�r.�eventsr#r2s&   r$�test_calc_screen_wrap_simple�'TestReader.test_calc_screen_wrap_simpleAs.����)��0��8�	��� � ��E�7�%��9r&c�b�[Q2o[U2vq#UOUQQ02P!)�u\
樂�aaaaaaaauaaaaaaaa樂rHrJs&   r$�%test_calc_screen_wrap_wide_characters�0TestReader.test_calc_screen_wrap_wide_charactersFs/����0��0��8�	��� � ��E�7�'�):�;r&c�h�[Q2o[U2vq#UOUQQQQ02P!)�z\
z\
aa�aaaaaaaaaaaaaaaaaaaarGrHrJs&   r$�!test_calc_screen_wrap_three_lines�,TestReader.test_calc_screen_wrap_three_linesKs5����)��0��8�	��� � ��E�7�$�u�g�V�)D�Er&c�f�Qo[Q2o[UUQ5vq4UOUQ2P!)c�x�[U-U@oU;QUmQUmQUmPUmP
UmP
UmU!)�>>> �... rr s*, r$�prepare_reader_keep_prompts�PTestReader.test_calc_screen_prompt_handling.<locals>.prepare_reader_keep_promptsQsH��#�T�4�V�4�F��!��F�J��F�J��F�J��F�J�"'�F�� %�F���Mr&z"if some_condition:
some_function()r*z6>>> if so\
me_condit\
ion:
...     s\
ome_funct\
ion()rH)r.r\rKr#r2s&    r$� test_calc_screen_prompt_handling�+TestReader.test_calc_screen_prompt_handlingPs>��		� � E�F��0��6�
�	��
	
� � ��
�
	
r&c�~�QQQQ0o[U2o[U2vq4UOUQQQQQ0P	Q5P!)	zdef f():
  z
  z\
a
  u\
樂樂��cleanrPu樂樂樂樂樂�aaaaaaau	樂樂樂rH�r.r/rKr#r2s&    r$�1test_calc_screen_wrap_three_lines_mixed_character�<TestReader.test_calc_screen_wrap_three_lines_mixed_characteross��
��w���y�
�	
� ��%��0��8�	��	
� � ����7���9����	!�
	
r&c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UQ2P!)�aaa�key�	backspace���evt�data�raw�aa)�	itertools�chainr
r
�	bytearrayrrIrJs&   r$�test_calc_screen_backspace�%TestReader.test_calc_screen_backspace�sL������5�!��%�k�y��7I�J�
�
��&�f�-�	��� � ���.r&c�v�[Q2o[PQ5o[VQ5oP
UmQ9UmUmQ9UmUmQQ,Um[UO2Um
UO2UO2UOUQ2UOUOQ	2P!)
N��readline_completer��console�configrZr[��z>>> ^@^[�)rOr)rrrrrrrr�buffer�len�pos�invalidate_full�refreshrIr+r-)r.rzr{r#s&   r$�,test_refresh_escapes_control_bytes_in_buffer�7TestReader.test_refresh_escapes_control_bytes_in_buffer�s���!�"�%���4�8��$�W�D��#���"(�(��
�V�Z�"(�(��
�V�Z���(��
�����'��
���� ������ � ���4�������V�,r&c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UQ2P!)rDrirjrkrlrFrG�rqrrr
r
rsrrIrJs&   r$�-test_calc_screen_wrap_removes_after_backspace�8TestReader.test_calc_screen_wrap_removes_after_backspace�sL������8�$��%�k�y��7I�J�
�
��1��8�	��� � ���1r&c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UQQ02P!)�rirjrkrlrE�aaaaaaaaaaarGr�rJs&   r$�4test_calc_screen_backspace_in_second_line_after_wrap�?TestReader.test_calc_screen_backspace_in_second_line_after_wrap�sR������8�$��%�k�y��7I�J�
�
��1��8�	��� � ��E�7�%��9r&c��[Q2o[U2vq#UO]]2UOUO]2P!)z11+11�r
r�setpos_from_xyr+r�rJs&   r$�test_setpos_for_xy_simple�$TestReader.test_setpos_for_xy_simple�s<����(��%�f�-�	�����a��#�������Q�'r&c��Qo[U2o[U2vq4UO]]2UOUO]
2P!)zdef foo():
  return 1r�rds&    r$�"test_setpos_from_xy_multiple_lines�-TestReader.test_setpos_from_xy_multiple_lines�sH��
�	
� ��%��%�f�-�	�����a��#�������R�(r&c��Qo[U2o[U2vq4UO]]2UOUO]
2P!�zdef foo():
  hello�r
rr�r+r�rds&    r$�test_setpos_from_xy_after_wrap�)TestReader.test_setpos_from_xy_after_wrap�sH��
�	
� ��%��0��8�	�����a��#�������R�(r&c��Qo[U2o[U2vq4UO]]2UOUO]	2P!r�r�rds&    r$�"test_setpos_fromxy_in_wrapped_line�-TestReader.test_setpos_fromxy_in_wrapped_line�sH��
�	
� ��%��0��8�	�����a��#�������Q�'r&c
���[[QQ[Q2Q5[QQ[Q2Q5,2o[U2vq#UO	UO
,P,12P!)ri��rl�up�OA)�iterr
rsr�assertInr,rJs&   r$�test_up_arrow_after_ctrl_r�%TestReader.test_up_arrow_after_ctrl_r�sY����%�f�)�G�2D�E��%�d�	�)�0D�E�
�
��&�f�-�	���
�
�f�m�m�b�2�$�Z�0r&c��Qo[O[U2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ	[	Q
2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,	2o[
O[P
Q5o[V#Q5vqEQ
oUOVFP	Q5UOUO2P!)zdef foo():
a = 1
rir�r�rl�sO5�
�
�downsOB)rr*z(def foo():
    
    
    a = 1
    
    ra)rqrrr
r
rs�	functools�partialrrrI�
assertTrue�finished)r.r/rK�no_paste_readerr#r2�expecteds&      r$�-test_newline_within_block_trailing_whitespace�8TestReader.test_newline_within_block_trailing_whitespace�s��
�	
�����4� ��%�d�	�)�0D�E��%�d�	�)�0D�E��%�f�)�I�2F�G��%�d�	�%�0@�A��%�d�	�%�0@�A��%�f�)�I�2F�G��%�f�)�I�2F�G��%�d�	�%�0@�A��%�d�	�%�0@�A�
�
��($�+�+�N�u�M��%�f�M�	��
�	�	
� � ��� �>�������(r&c�`�[2nU1Qko[Q2o[V!Q5vq4UO[	RO
2]2P!)c�:`�[2nUROm]dRm]PRm[U1QkQ5RmRRmR!)�dc�6:�RORO1!)N)�height�width)rzs�r$�<lambda>�WTestReader.test_input_hook_is_called_if_set.<locals>._prepare_console.<locals>.<lambda>!s���G�N�N�T[�Ta�Ta�Cbr&)�side_effect)r�	get_eventr�r�r��getheightwidth�
input_hook)rKrzr�s&@�r$�_prepare_console�ETestReader.test_input_hook_is_called_if_set.<locals>._prepare_consolesA����k�G�,2�G���)� �G�N��G�M�%.�;b�%c�G�"�!+�G���Nr&�a)r)rr
rr+r��
mock_calls)r.r�rKr#r2r�s&    @r$� test_input_hook_is_called_if_set�+TestReader.test_input_hook_is_called_if_setsB����[�
�	� ��$��%�f�O�	������Z�2�2�3�Q�7r&c�r�Q[-oQo[O[U2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2o[U2o[
U[OU2OQ5oUO2J[ctSO[SO2]6�2SO!2SO#[SO2]2SO%XRP	Q	5P!h9h)
rqzimport itertools
itertools.ri�	�	rl��rwra)rqrrr
r
rsrr�rlcompleter�	Completer�complete�handle1�fail�KeyboardInterruptr�r�r,r�r+rI)r.�	namespacer/rKrzr#s&     r$�%test_keyboard_interrupt_clears_screen�0TestReader.test_keyboard_interrupt_clears_screen*s�� �)�,�	�-������4� ��%�d�	�%�0@�A��%�d�	�%�0@�A��%�f�)�G�2D�E�	
�
��"�&�)����*�4�4�Y�?�H�H�
��	7����� �� �	?��O�O�C��
�
�.��2�3��N�N�����S����/��3��$�$�V��$�>�
	?�s�%B8�8	D6�A0D6�5D6c�p�Qo[OU2vq#UOV!2UOU]2Qo[OU2vq#UOUQ2UOU]2Qo[OU2vq#UOUQ2UOU]2Qo[OU2vq#UOV!2UOU]2Qo[OU2vq#UOUQ2UOU]2P!)rZz>>> z>>> u樂>> u樂>> u樂>> )r�process_promptr+)r.r�prompt�ls&   r$�test_prompt_length�TestReader.test_prompt_lengthKs�����)�)�#�.�	������%�����A��&���)�)�#�.�	������!8�9�����A��6���)�)�#�.�	������!8�9�����A�����)�)�#�.�	������%�����A��8���)�)�#�.�	������!:�;�����A�r&c�0�[,]Q5o[U[2Q5oQUmQUmQUmPUmP
UmP
UmUO2UOUOQ2UOUO,2P!)r)r�ryrZr[�rr)
rrrrrrrrr�preparer+r-r,�r.rzr#s&  r$�+test_prepare_with_zero_width_does_not_crash�6TestReader.test_prepare_with_zero_width_does_not_crashjs{��!�"�A�.��$�W�^�=M�N����
���
���
���
�#���!�������������V�,��������+r&c�,�Q[-oQo[O[U2[QQ[	Q2Q5[QQ[	Q2Q5,[Q22o[
O[[OU2OQ5o[V4Q5vqVUOoUO[U2]2UOU]*UQ02UOU]*O2Q	2P!)
rq�
itertools.rir�r�rlr�rwr*zitertools.accumulate()rqrrr
r
rsr�r�rr�r�r�rr,r+r��rstrip)r.r�r/rK�completing_readerr#r2�actuals&       r$�%test_completions_updated_on_key_press�0TestReader.test_completions_updated_on_key_pressys��� �)�,�	�������4� ��%�d�	�%�0@�A��%�d�	�%�0@�A�
�

�3��
��&�-�-��*�4�4�Y�?�H�H�
��&�f�O�	����������V��a�(�������t�f�A�J�/�������)�)�+�-D�Er&c
�T�Q[-oQo[O[U2[QQ[	Q2Q5,[Q22o[
O[[OU2OQ5o[V4Q5vqVUOVRQ02P!)	rqr�rir�r�rlr�rwr*)
rqrrr
r
rsr�r�rr�r�r�rrI)r.r�r/rKr�r#r2s&      r$� test_key_press_on_tab_press_once�+TestReader.test_key_press_on_tab_press_once�s��� �)�,�	�������4� ��%�d�	�%�0@�A�
�
�3��
��&�-�-��*�4�4�Y�?�H�H�
��&�f�O�	��� � ��6���4r&c��[,2o[U2o[Q2UmUO	UO2Q2P!)rr~r�)rrr�layoutr+�pos2xyr�s&  r$�test_pos2xy_with_no_columns�&TestReader.test_pos2xy_with_no_columns�s7��!�"�%����(��!�"�
��
��������&�1r&c��Qo[U2o[U2vq4UO]]2UOUO]2P!)u# non ‌ printing characterr�rds&    r$�)test_setpos_from_xy_for_non_printing_char�4TestReader.test_setpos_from_xy_for_non_printing_char�sA��0����%��%�f�-�	�����a��#�������Q�'r&r~) �__name__�
__module__�__qualname__�__firstlineno__r3r<rArLrQrVr^rertr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__static_attributes__�__classdictcell__��
__classdict__s@r$r(r(#s�����3�
�

�:�
<�
F�

�>
�4/�-� 2�:�(�)�)�(�	1�()�T8�"7�B�>
,�F�05�&2�(�(r&r(c�R`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sUs
P!)�TestReaderInColor�c
���[Q2o[Q2oUOQQP-[@o[U2o[	U2vqVUOVQP	Q5UOVS2UO
UOQ2UO
UOQ2QOQ-[@oUOQQU-[@o[O[U2[QQ[Q2Q	5,]*[Q
22o	[	U	2vqVUOVX2UO
UO]2UO
UOQ
2P!)ao            import re, sys
            def funct(case: str = sys.platform) -> None:
                match = re.search(
                    "(me)",
                    '''
                    Come on
                      Come on now
                        You know that it's time to emerge
                    ''',
                )
                match case:
                    case "emscripten": print("on the web")
                    case "ios" | "android":
                        print("on the phone")
                    case _: print('arms around', match.group(1))
            type type = type[type]
            a�            {k}import{z} re{o},{z} sys
            {a}{k}def{z} {d}funct{z}{o}({z}case{o}:{z} {b}str{z} {o}={z} sys{o}.{z}platform{o}){z} {o}->{z} {k}None{z}{o}:{z}
                match {o}={z} re{o}.{z}search{o}({z}
                    {s}"(me)"{z}{o},{z}
                    {s}'''{z}
            {s}        Come on{z}
            {s}          Come on now{z}
            {s}            You know that it's time to emerge{z}
            {s}        '''{z}{o},{z}
                {o}){z}
                {K}match{z} case{o}:{z}
                    {K}case{z} {s}"emscripten"{z}{o}:{z} {b}print{z}{o}({z}{s}"on the web"{z}{o}){z}
                    {K}case{z} {s}"ios"{z} {o}|{z} {s}"android"{z}{o}:{z}
                        {b}print{z}{o}({z}{s}"on the phone"{z}{o}){z}
                    {K}case{z} {K}_{z}{o}:{z} {b}print{z}{o}({z}{s}'arms around'{z}{o},{z} match{o}.{z}group{o}({z}{n}1{z}{o}){z}{o}){z}
            {K}type{z} {b}type{z} {o}={z} {b}type{z}{o}[{z}{b}type{z}{o}]{z}
            r�ra�z{k}async{z} rir�r�rlzasync r~)r�)�r9)
r�format�colorsr
rrIr+r�r-rqrrr
rs)
r.r/r��
expected_syncrKr#r2�	async_msg�expected_async�more_eventss
&         r$�test_syntax_highlighting_basic�0TestReaderInColor.test_syntax_highlighting_basic�s=���
�
��(�
�
��(!���7�"�7��7�
���%��%�f�-�	��� � ��T� �:�� � ��7�������S�)�������W�-�"�)�)�3�F�3�	�!���?�9�?��?���o�o��4� �
�u�4�Y�y�-A�
B�C�b�H��8�$�
��
&�k�2�	��� � ��8�������R�(�������V�,r&c���[Q2o[Q2OQ-[@o[U2o[	U2vqEUOVAP	Q5UOVB2P!)zI            def unfinished_function(arg: str = "still typing
            zs            {k}def{z} {d}unfinished_function{z}{o}({z}arg{o}:{z} {b}str{z} {o}={z} {s}"still typing{z}
            rar~�rrrr
rrI�r.r/r�rKr#r2s&     r$�5test_syntax_highlighting_incomplete_string_first_line�GTestReaderInColor.test_syntax_highlighting_incomplete_string_first_line�sv���
�
��
�
�
��&�	���	��
 ��%��%�f�-�	��� � ��T� �:�� � ��2r&c���[Q2o[Q2OQ-[@o[U2o[	U2vqEUOVAP	Q5UOVB2P!)zZ            def unfinished_function(
                arg: str = "still typing
            z�            {k}def{z} {d}unfinished_function{z}{o}({z}
                arg{o}:{z} {b}str{z} {o}={z} {s}"still typing{z}
            rar~rrs&     r$�7test_syntax_highlighting_incomplete_string_another_line�ITestReaderInColor.test_syntax_highlighting_incomplete_string_another_linesv���
�
���
�
�
�&���
��� ��%��%�f�-�	��� � ��T� �:�� � ��2r&c���[Q2o[Q2OQ-[@o[U2o[	U2vqEUOVAP	Q5UOVB2P!)zr            def unfinished_function():
                '''Still writing
                the docstring
            z�            {k}def{z} {d}unfinished_function{z}{o}({z}{o}){z}{o}:{z}
                {s}'''Still writing{z}
            {s}    the docstring{z}
            rar~rrs&     r$�4test_syntax_highlighting_incomplete_multiline_string�FTestReaderInColor.test_syntax_highlighting_incomplete_multiline_string�v���
�
���
�
��&�
���
�� ��%��%�f�-�	��� � ��T� �:�� � ��2r&c���[Q2o[Q2OQQQQQ-[@o[U2o[	U2vqEUOVAP	Q5UOVB2P!)z�            def unfinished_function():
                var = f"Single-quote but {
                1
                +
                1
                } multi-line!
            a            {k}def{z} {d}unfinished_function{z}{o}({z}{o}){z}{o}:{z}
                var {o}={z} {s}f"{z}{s}Single-quote but {z}{o}{OB}{z}
                {n}1{z}
                {o}+{z}
                {n}1{z}
                {o}{CB}{z}{s} multi-line!{z}
            �OB�{�CB�}rar~rrs&     r$�+test_syntax_highlighting_incomplete_fstring�=TestReaderInColor.test_syntax_highlighting_incomplete_fstring's����
�	
���
�	
��&�	�	+��	+� �	+�$*�	+�� ��%��%�f�-�	��� � ��T� �:�� � ��2r&c���[Q2o[Q2OQ-[@o[U2o[	U2vqEUOVAP	Q5UOVB2P!)z_            def unfinished_function():
                var = 1
               oops
            z�            {k}def{z} {d}unfinished_function{z}{o}({z}{o}){z}{o}:{z}
                var {o}={z} {n}1{z}
               oops
            rar~rrs&     r$�*test_syntax_highlighting_indentation_error�<TestReaderInColor.test_syntax_highlighting_indentation_errorArr&c�$�[Q2o[Q2OQ-[@OQQ2OQQ2o[	U2o[U2vqEUO
VAP	Q5PUmUO
VB2P!)z�            f"{{"
            f"}}"
            f"a{{b"
            f"a}}b"
            f"a{{b}}c"
            t"a{{b}}c"
            f"{{{0}}}"
            f"{ {0} }"
            a�            {s}f"{z}{s}<<{z}{s}"{z}
            {s}f"{z}{s}>>{z}{s}"{z}
            {s}f"{z}{s}a<<{z}{s}b{z}{s}"{z}
            {s}f"{z}{s}a>>{z}{s}b{z}{s}"{z}
            {s}f"{z}{s}a<<{z}{s}b>>{z}{s}c{z}{s}"{z}
            {s}t"{z}{s}a<<{z}{s}b>>{z}{s}c{z}{s}"{z}
            {s}f"{z}{s}<<{z}{o}<{z}{n}0{z}{o}>{z}{s}>>{z}{s}"{z}
            {s}f"{z}{o}<{z} {o}<{z}{n}0{z}{o}>{z} {o}>{z}{s}"{z}
            �<r�>rrar~)rrr�replacer
rrI�maxDiffrs&     r$�<test_syntax_highlighting_literal_brace_in_fstring_or_tstring�NTestReaderInColor.test_syntax_highlighting_literal_brace_in_fstring_or_tstringUs����	
�
���	
�
��&�����#�7�3��,�W�W�S�#�->�	� ��%��%�f�-�	��� � ��T� �:����� � ��2r&c��Qo[U2o[U2vq4UOUQP	Q5UOUQOQ-[@2P!)uflag = "🏳️‍🌈"uflag = "🏳️\u200d🌈"rau&flag {o}={z} {s}"🏳️\u200d🌈"{z}r~)r
rrIrrrds&    r$�test_control_characters�)TestReaderInColor.test_control_characterstsS��(����%��%�f�-�	��� � ��)F�d� �S�� � ��)R�)Y�)Y�)c�\b�)c�dr&)r$)r�r�r�r�rr
rrrrr%r(r�r�r�s@r$r�r��s5����;-�z3� 3�$3�(3�43�(3�>e�er&r�)'rqr�r��textwrapr�unittestr�
unittest.mockr�test.supportrr�supportrrr	r
rr�_pyrepl.consoler
�_pyrepl.layoutr�_pyrepl.readlinerr�_pyrepl.readerr�	_colorizer�	overrides�syntax�items�get�lowerrr%r(r�)�k�vs00r$�<module>r;s��������#�S�D�5�4�!�$�@�!�#��c�>�3�/�	�8E�8L�8L�8R�8R�8T�	U�8T���)�-�-��Q�4�:�:�<�
(�!�
+�8T�	U��	� �L(�!�8�L(� �L(�\�Fe�(�(�Fe��Fe��
Vs�4C!

Youez - 2016 - github.com/yon3zu
LinuXploit