403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/tests/__pycache__/test_backend_tk.cpython-312.pyc
�

 lf�#��,�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
Z
ddlZddlmZddl
mZddlmZddlmZdZdd�Zed�	�d
��Zed�	�d��Ze
j0j3ej4�d
k7d��e
j0j7d��ed�	�d����Ze
j0j;dd��e
j0j7d��ed�	�d����Ze
j0j;dd��ed�	�d���Zed�	�d��Z e
j0j;dd��ed�	�d���Z!ed�	�d��Z"y)�N)�Image)�_c_internal_utils)�ToolToggleBase)�subprocess_run_helper�<c�������tjt��Sdtjvr�St
jjtjjd�d��t
jjtjdk(xrtj�d��tj����fd����}|S)z�
    A decorator to run *func* in a subprocess and assert that it prints
    "success" *success_count* times and nothing on stderr.

    TkAgg tests seem to have interactions between tests, so isolate each test
    in a subprocess. See GH#18261
    �MPL_TEST_ESCAPE_HATCH�tkinterzmissing tkinter��reason�linuxz'$DISPLAY and $WAYLAND_DISPLAY are unsetc�&���tjd�	t�tt	dd����}gd�}|j
j
�D��cgc]�t�fd�|D��r���c}rJ�|jjd��k(sJ�ycc}w#tj$rtjd	�Yytj$r5}tjd
t|j
�z�Yd}~yd}~wwxYw)Nr
�TkAgg�1)�
MPLBACKENDr	)�timeout�	extra_env)�OpenGLz!CFMessagePort: bootstrap_registerz%/usr/include/servers/bootstrap_defs.hc3�&�K�|]}|�v���
y�w�N�)�.0�msg�lines  ��B/usr/lib/python3/dist-packages/matplotlib/tests/test_backend_tk.py�	<genexpr>z7_isolated_tk_test.<locals>.test_func.<locals>.<genexpr>Gs�����H�3�s�$��H�s��successzSubprocess timed outz,Subprocess failed to test intended behavior
)�pytest�importorskipr�
_test_timeout�dict�stderr�
splitlines�all�stdout�count�
subprocess�TimeoutExpired�fail�CalledProcessError�str)�proc�
ignored_linesr�e�func�
success_counts  ` ��r�	test_funcz$_isolated_tk_test.<locals>.test_func(s����	���I�&�	A�(��m�t�&�c�8C�D�D�F�M�)-���)?�)?�)A�J���H�-�H�H��J�
J�J��;�;�$�$�Y�/�=�@�@�@��J���(�(�	0��K�K�.�/��,�,�	)��K�K�G��a�h�h�-�(�
)�
)��	)�s#�B�B�(D�	D�+D�D)�	functools�partial�_isolated_tk_test�os�environr�mark�skipif�	importlib�util�	find_spec�sys�platformr�display_is_valid�wraps)r0r/r1s`` rr4r4s�����|�� � �!2�M�B�B��"�*�*�,����[�[����N�N�$�$�Y�/�/� ����[�[��������L�(9�(J�(J�(L�$L�8����_�_�T��A��	�	�A�2���)r0c	��ddlm}ddl}ddl}ddlm}|j�\}}|jj}|jd�}|jdd\}}	||	|jjf}
d}|D]:}	|j|jj�t!|�|
dd|��<y#t"$rt%d�Y�TwxYw)Nr)�_tkagg)�rDrD�))���rErrE)rErrrE)�rArrE)rrErFrE)rrErEr)rrErGrA)rrGrE�r)�matplotlib.pyplot�pyplot�numpy�!matplotlib.backends.backend_tkagg�matplotlib.backendsrC�subplots�canvas�_tkphoto�ones�shape�ctypes�data�blit�tk�
interpaddrr+�
ValueError�print)
�plt�np�
matplotlibrC�fig�ax�
photoimagerT�height�width�dataptr�	bad_boxes�bad_boxs
             r�	test_blitreMs���#��,�*��c�l�l�n�G�C�����$�$�J�
�7�7�9��D��J�J�r��N�M�F�E��u�d�k�k�.�.�/�G��I����	��K�K��
�
�(�(�*�C�
�O�W�a��g�
'���
�	��)��	�s�7B=�=C�CrGc������ddl}ddlm�g����fd�}��fd��|j���j	d|��j��rt
d�yy)Nrc����j��jddgddg��j��jd��y)NrGrErH�r)�figure�plot�close�after)�legitimate_quitrZ�roots���r�do_plotz;test_figuremanager_preserves_host_mainloop.<locals>.do_plotos?�����
�
������!�Q��!�Q�� ���	�	���
�
�1�o�&r@c�H���j��jd�y�NT)�quit�append)rnrs��rrmzCtest_figuremanager_preserves_host_mainloop.<locals>.legitimate_quitus����	�	�����t�r@r)r
rIrJ�Tkrl�mainlooprY)r
rormrZrnrs  @@@@r�*test_figuremanager_preserves_host_mainlooprvisL����#��G�'���:�:�<�D��J�J�q�'���M�M�O��
�i��r@�CPythonzZPyPy does not support Tkinter threading: https://foss.heptapod.net/pypy/pypy/-/issues/1929rrH)�rerunsc�f�����ddl}ddl�ddlm�ddl}ddlm�|j�}�jgd�gd������fd�}|j��|j|d��}|j��jd���j�|j�y)	Nr)�"_get_running_interactive_framework�rGrErH)rGrErhc���d��k(s�jd�d��k(s��j��j�rtd�yy)NrVg{�G�z�?r)�sleeprk�waitrY)rzrZ�show_finished_event�times����r�targetz6test_figuremanager_cleans_own_mainloop.<locals>.target�sL����<�>�>��J�J�s�O��<�>�>���	�	���#�#�%��)��&r@T)r��daemon��block)r
r�rIrJ�	threading�matplotlib.cbookrzrtrj�Event�Thread�start�show�set�join)	r
r�rnr��threadrzrZrr�s	     @@@@r�&test_figuremanager_cleans_own_mainloopr��s������#��C��:�:�<�D��C�H�H�Y�	�"��$�/�/�+��
�
�
�V�D�
�
9�F�
�L�L�N��C�H�H�4������
�K�K�Mr@rT)�skip_on_importerrorc��ddl}|j`|j`ddlm}|j�}|jd��|j�|jjj�|jj�jd|j|�|jd��y)NrFr��dT)r
�Misc�update�update_idletasksrIrJrir��drawrO�toolbar�configure_subplots�
get_tk_widgetrlrk)r
rZr]s   r�test_never_updater��s�����������%�#�
�#�*�*�,�C��C�H�H�5���C�H�H�J��J�J���)�)�+��J�J����$�$�S�#�)�)�S�9�
�C�H�H�4�r@c���tj�5tjdt�dtj
d<ddd�t
j�5}tjdd�}tjj|d��|j��G�fd�dt�}tj �}|j"j$j&}|j"j$j(}|j+d	|�|j+d	d
�ddd�y#1swY��xYw#1swYyxYw)N�ignore�toolmanagerr��LA)�r�ztest_la_icon.pngc���eZdZW�Zy)�4test_toolbar_button_la_mode_icon.<locals>.CustomToolN)�__name__�
__module__�__qualname__�image)�tmp_img_paths�r�
CustomToolr��s��� �Er@r��test�group)�warnings�catch_warnings�simplefilter�UserWarningr\�rcParams�tempfile�TemporaryDirectoryr�newr5�pathr��saverrZrirO�managerr�r��add_tool)�tempdir�imgr�r]r�r�r�s      @r� test_toolbar_button_la_mode_iconr��s���
�	 �	 �	"�7����h��4�)6�
���I�&�7�

�	$�	$�	&�*�'��i�i��h�'���w�w�|�|�G�-?�@�������	!��	!��j�j�l���j�j�(�(�4�4���*�*�$�$�,�,�����V�Z�0������)�*�*�7�7��
*�*�s�.D:� CE�:E�ErEc����ddlm}ddlm�G�fd�d��}|j�}td�||j|jjj�td�y)Nr)�NavigationToolbar2Tkc�b��eZdZW�jD��cgc]}|ddvr|��
c}}Zycc}}w)�)test_missing_back_button.<locals>.Toolbarr)�Home�Pan�ZoomN)r�r�r��	toolitems)r�tr�s00�r�Toolbarr��s2��� 4� >� >�6�1��q�T�4�4��6�	��6s�+r�r)	rIrJrLr�rirYrOr��window)rZr�r]r�s   @r�test_missing_back_buttonr��sS���#�F�6�&�6�
�#�*�*�,�C�	�)���C�J�J��
�
�*�*�1�1�2�	�)�r@c�6�����ddl}ddlm�g�����fd�}|j���j���j
gd���j
d�j��j
d|��j��rtd�yy)Nrc����jj�}|j�s|j�|j	�|k(r�jd��j��j�yrq)rOr��winfo_viewable�wait_visibility�
focus_lastforrsrk�destroy)�tkcanvasr]rZrnrs ����r�check_focusz&test_canvas_focus.<locals>.check_focus�s`����:�:�+�+�-���&�&�(��$�$�&��!�!�#�x�/��N�N�4� ���	�	�����r@r{r�r)
r
rIrJrtrirjrlr�rurY)rVr�r]rZrnrs  @@@@r�test_canvas_focusr��sv����#��G�
��5�5�7�D�
�#�*�*�,�C��C�H�H�Y���J�J�q�#�(�(���J�J�s�K� ��M�M�O��
�i��r@c�������ddl}ddlm�m�ddlm�ddlm�|j�}����fd�}||�td�|jddd	�
�||�td�y)Nr)�FigureCanvasTkAggr�)�key_press_handler)�Figurec�����}|j�}|jgd���||��}|j�|jd��|j	�jdd���||d��}|jdd	��|j	�j
�|j
�y)
Nr{)�master�key_press_eventT�both)�expand�fillF)�pack_toolbar�x)�add_subplotrjr��mpl_connectr��pack�forget)	r�r]r^rOr�r�r�r�r�s	     ����r�test_figurez#test_embedding.<locals>.test_figure
s�����h��
�_�_�
��
���	��"�3�v�6�����
����,�.?�@�����#�#�4�f�#�=�&�v�v�E�J�����D�s��+�����%�%�'����r@rzsky bluez
midnight blue�white)�
background�selectColor�
foreground)r
rLr�r��matplotlib.backend_basesr��matplotlib.figurer�rtrY�
tk_setPalette)rVrnr�r�r�r�r�s   @@@@r�test_embeddingr�s_����1�:�(�
�5�5�7�D�� ���	�)��
	���*�/�")��+����	�)�r@r)#r2r9r5r=r'r<r�r��PILrrr\r�matplotlib.backend_toolsr�matplotlib.testingrrIrJrZr r4rervr7r8�python_implementation�flakyr��backendr�r�r�r�r�rr@r�<module>r�s�����	���
����
��(�3�4���
�2�j��#��$��6��#��$��.�����2�H�2�2�4�	�A�O��P������!�����#��$��P�
�2�����W�$��7������!�����#��$��8��,�����W�$��7���#�*�$�8�*�0��#��$�������W�$��7���#��$�8��8��#�"�$�"r@

Youez - 2016 - github.com/yon3zu
LinuXploit