403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.117
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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

G8�cv1��n�ddlmZmZmZmZGd�d�ZGd�de�ZGd�d�ZGd�d	�Zy
)�)�_api�
backend_tools�cbook�widgetsc��eZdZdZdd�Zy)�	ToolEventz)Event for tool manipulation (add/remove).Nc�<�||_||_||_||_y�N)�name�sender�tool�data)�selfrrr
rs     �=/usr/lib/python3/dist-packages/matplotlib/backend_managers.py�__init__zToolEvent.__init__s����	������	���	�r
��__name__�
__module__�__qualname__�__doc__r�rrrrs
��3�rrc�$��eZdZdZd�fd�	Z�xZS)�ToolTriggerEventz/Event to inform that a tool has been triggered.c�8��t�|�||||�||_yr
)�superr�canvasevent)rrrr
rr�	__class__s      �rrzToolTriggerEvent.__init__s���
����v�t�T�2�&��r)NN)rrrrr�
__classcell__)rs@rrr
s���9�'�'rrc��eZdZdZd�Zy)�ToolManagerMessageEventzs
    Event carrying messages from toolmanager.

    Messages usually get displayed to the user by the toolbar.
    c�.�||_||_||_yr
)rr�message)rrrr#s    rrz ToolManagerMessageEvent.__init__s����	������rNrrrrr!r!s���
rr!c���eZdZdZdd�Zed��Zed��Zejd��Zdd�Z	d�Z
d	�Zdd
�Zed��Z
d�Zd
�Zd�Zd�Zd�Zd�Zdd�Zd�Zed��Zdd�Zy)�ToolManagera�
    Manager for actions triggered by user interactions (key press, toolbar
    clicks, ...) on a Figure.

    Attributes
    ----------
    figure : `.Figure`
    keypresslock : `~matplotlib.widgets.LockDraw`
        `.LockDraw` object to know if the `canvas` key_press_event is locked.
    messagelock : `~matplotlib.widgets.LockDraw`
        `.LockDraw` object to know if the message is available to write.
    Nc��d|_i|_i|_i|_t	j
�|_tj�|_	tj�|_
d|_|j|�yr
)
�_key_press_handler_id�_tools�_keys�_toggledr�CallbackRegistry�
_callbacksr�LockDraw�keypresslock�messagelock�_figure�
set_figure�r�figures  rrzToolManager.__init__.sf��%)��"������
���
��0�0�2���$�,�,�.���"�+�+�-����������rc�H�|jsy|jjS)z Canvas managed by FigureManager.N)r0�canvas�rs rr5zToolManager.canvas>s���|�|���|�|�"�"�"rc��|jS)zFigure that holds the canvas.)r0r6s rr3zToolManager.figureEs���|�|�rc�&�|j|�yr
)r1r2s  rr3zToolManager.figureJs������rc� �|jr%|jj|j�||_|r+|jj	d|j
�|_|r'|jj�D]	}||_�yy)z�
        Bind the given figure to the tools.

        Parameters
        ----------
        figure : `.Figure`
        update_tools : bool, default: True
            Force tools to update figure.
        �key_press_eventN)	r'r5�mpl_disconnectr0�mpl_connect�
_key_pressr(�valuesr3)rr3�update_toolsr
s    rr1zToolManager.set_figureNsz���%�%��K�K�&�&�t�'A�'A�B�����)-���)@�)@�!�4�?�?�*4�D�&�����*�*�,�
%��$���
%�rc�:�|jj||�S)a�
        Connect event with string *s* to *func*.

        Parameters
        ----------
        s : str
            The name of the event. The following events are recognized:

            - 'tool_message_event'
            - 'tool_removed_event'
            - 'tool_added_event'

            For every tool added a new event is created

            - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.

        func : callable
            Callback function for the toolmanager event with signature::

                def func(event: ToolEvent) -> Any

        Returns
        -------
        cid
            The callback id for the connection. This can be used in
            `.toolmanager_disconnect`.
        )r,�connect)r�s�funcs   r�toolmanager_connectzToolManager.toolmanager_connectbs��8���&�&�q�$�/�/rc�8�|jj|�S)z�
        Disconnect callback id *cid*.

        Example usage::

            cid = toolmanager.toolmanager_connect('tool_trigger_zoom', onpress)
            #...later
            toolmanager.toolmanager_disconnect(cid)
        )r,�
disconnect)r�cids  r�toolmanager_disconnectz"ToolManager.toolmanager_disconnect�s�����)�)�#�.�.rc�b�|�|}d}t|||�}|jj||�y)z!Emit a `ToolManagerMessageEvent`.N�tool_message_event)r!r,�process)rr#rrB�events     r�
message_eventzToolManager.message_event�s3���>��F� ��'��6�7�;��������5�)rc��|jS)zCurrently toggled tools.)r*r6s r�
active_togglezToolManager.active_toggle�s���}�}�rc�v�|jj�D��cgc]
\}}||k(s�|��}}}|Scc}}w)a
        Return the keymap associated with the specified tool.

        Parameters
        ----------
        name : str
            Name of the Tool.

        Returns
        -------
        list of str
            List of keys associated with the tool.
        )r)�items)rr�k�i�keyss     r�get_tool_keymapzToolManager.get_tool_keymap�s8��#�j�j�.�.�0�>�d�a��A��I��>��>����?s�
5�5c�J�|j|�D]}|j|=�yr
)rUr))rrrRs   r�_remove_keyszToolManager._remove_keys�s'���%�%�d�+�	�A��
�
�1�
�	rc	�"�||jvrt|�d���|j|�t|t�r|g}|D]J}||j
vr+t
jd|�d|j
|�d|���||j
|<�Ly)z�
        Set the keymap to associate with the specified tool.

        Parameters
        ----------
        name : str
            Name of the Tool.
        key : str or list of str
            Keys to associate with the tool.
        z
 not in ToolszKey z changed from z to N)r(�KeyErrorrW�
isinstance�strr)r�
warn_external)rr�keyrRs    r�
update_keymapzToolManager.update_keymap�s����t�{�{�"��d�X�]�3�4�4����$���c�3���%�C��	!�A��D�J�J���"�"��1�#�^�D�J�J�q�M�?�$�t�f�E�G� �D�J�J�q�M�		!rc�z�|j|�}tjtjj
|dd��}|�|�t
|dd�r|j|d�|j|�td||�}|jj|j|�|j|=y)z�
        Remove tool named *name*.

        Parameters
        ----------
        name : str
            Name of the tool.
        z3.6�tool_removed_event)�since�alternativeN�toggledF�toolmanager)�get_toolr�deprecate_method_overrider�ToolBase�destroy�getattr�trigger_toolrWrr,rKrr()rrr
rhrLs     r�remove_toolzToolManager.remove_tool�s����}�}�T�"���0�0��"�"�*�*�D��,�.�����I��4��E�*����d�M�2����$���.��d�;��������
�
�E�2��K�K��rc���tjt|j�|�}|st	dt|�z��||jvr$tjd�|j|S|dk(rE|tjk7r2tjdd|j�d|j�d���|||g|��i|��}||j|<|j�|j||j�t|tj �rv|j"�%|j$j'd	t)��n&|j$j'|j"d	�|j*r|j-|d	d	�|j/|j0�t3d
||�}|j4j7|j8|�|S)a�
        Add *tool* to `ToolManager`.

        If successful, adds a new event ``tool_trigger_{name}`` where
        ``{name}`` is the *name* of the tool; the event is fired every time the
        tool is triggered.

        Parameters
        ----------
        name : str
            Name of the tool, treated as the ID, has to be unique.
        tool : type
            Class of the tool to be added.  A subclass will be used
            instead if one was registered for the current canvas class.

        Notes
        -----
        args and kwargs get passed directly to the tools constructor.

        See Also
        --------
        matplotlib.backend_tools.ToolBase : The base class for tools.
        zImpossible to find class for %sz;A "Tool class" with the same name already exists, not added�cursorz3.5zOverriding ToolSetCursor with z� was only necessary to provide the .set_cursor() method, which is deprecated since %(since)s and will be removed %(removal)s. Please report this to the z author.)r#N�tool_added_event)r�_find_tool_class�typer5�
ValueErrorr[r(rr\�
SetCursorBase�warn_deprecatedrr�default_keymapr^rZ�ToolToggleBase�radio_groupr*�
setdefault�setrc�_handle_toggler1r3rr,rKr)rrr
�args�kwargs�tool_cls�tool_objrLs        r�add_toolzToolManager.add_tool�s���2!�1�1�$�t�{�{�2C�T�J����>��T��J�K�K��4�;�;����� 3�
4��;�;�t�$�$��8���M�,G�,G� G�� � ��)I�$,�$9�$9�#:�;K�
%-�$7�$7�#8��
*B�
C��D�$�8��8��8��$����D���"�"�.����t�X�%<�%<�=��h�
� <� <�=��#�#�+��
�
�(�(��s�u�5��
�
�(�(��)=�)=�t�D�����#�#�H�d�D�9����D�K�K�(��,�d�H�=��������
�
�E�2��rc���|j}|�m|j|jdvr)|jdj|j�y|jdj	|j�y|j||jk(rd}nI|j|�
|j}n-|j|j||||�|j}||j|<y)aO
        Toggle tools, need to untoggle prior to using other Toggle tool.
        Called from trigger_tool.

        Parameters
        ----------
        tool : `.ToolBase`
        canvasevent : Event
            Original Canvas event or None.
        data : object
            Extra data to pass to the tool when triggering.
        N)rvrr*�remove�addrj)rr
rrrvrcs      rryzToolManager._handle_toggle's����&�&�����y�y�D�M�M�$�/�/��
�
�d�#�*�*�4�9�9�5�
��
�
�d�#�'�'��	�	�2���=�=��%����2��G��]�]�;�
'�
/��i�i�G�
���d�m�m�K�8�"�)�"�
$��i�i�G�&-��
�
�k�"rc��|j|�}|�y|�|}t|tj�r|j	|||�|j|||�d|z}t
|||||�}|jj||�y)a�
        Trigger a tool and emit the ``tool_trigger_{name}`` event.

        Parameters
        ----------
        name : str
            Name of the tool.
        sender : object
            Object that wishes to trigger the tool.
        canvasevent : Event
            Original Canvas event or None.
        data : object
            Extra data to pass to the tool when triggering.
        Nztool_trigger_%s)	rerZrrury�triggerrr,rK)rrrrrr
rBrLs        rrjzToolManager.trigger_toolRs����}�}�T�"���<���>��F��d�M�8�8�9�����k�4�8����V�[�$�/���$�� ��F�D�+�t�D��������5�)rc���|j�|jj�ry|jj	|jd�}|�y|j||��y)N)r)r]r.�lockedr)�getrj)rrLrs   rr=zToolManager._key_pressqsS���9�9��� 1� 1� 8� 8� :���z�z�~�~�e�i�i��.���<�����$�E��2rc��|jS)z,A dict mapping tool name -> controlled tool.)r(r6s r�toolszToolManager.toolszs���{�{�rc���t|tj�r|j|jvr|S||jvr|rtjd|���y|j|S)a�
        Return the tool object with the given name.

        For convenience, this passes tool objects through.

        Parameters
        ----------
        name : str or `.ToolBase`
            Name of the tool, or the tool itself.
        warn : bool, default: True
            Whether a warning should be emitted it no tool with the given name
            exists.

        Returns
        -------
        `.ToolBase` or None
            The tool or None if no tool with the given name exists.
        z"ToolManager does not control tool N)rZrrgrr(rr\)rr�warns   rrezToolManager.get_toolsc��&
�t�]�3�3�4��I�I����,��K��t�{�{�"���"�"�8���A�C���{�{�4� � rr
)T)NNN)rrrrr�propertyr5r3�setterr1rDrHrMrOrUrWr^rkr~ryrjr=r�rerrrr%r% s���� � �#��#������]�]� �� �%�(0�<
/�*������$�!�,�8C�J)-�V*�>3�����!rr%N)	�
matplotlibrrrrrrr!r%rrr�<module>r�s7��:�:���'�y�'�	�	�z!�z!r

Youez - 2016 - github.com/yon3zu
LinuXploit