403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/core/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/core/__pycache__/events.cpython-311.pyc
�

�@�c����dZddlmZGd�de��ZiZd�Zed���Zed���Zed���Z	ed	���Z
ed
���ZdS)aoInfrastructure for registering and firing callbacks on application events.

Unlike :mod:`IPython.core.hooks`, which lets end users set single functions to
be called at specific times, or a collection of alternative methods to try,
callbacks are designed to be used by extension authors. A number of callbacks
can be registered for the same event without needing to be aware of one another.

The functions defined in this module are no-ops indicating the names of available
events and the arguments which will be passed to them.

.. note::

   This API is experimental in IPython 2.0, and may be revised in future versions.
�)�callback_prototypec�*�eZdZdZd�Zd�Zd�Zd�ZdS)�EventManagera3Manage a collection of events and a sequence of callbacks for each.
    
    This is attached to :class:`~IPython.core.interactiveshell.InteractiveShell`
    instances as an ``events`` attribute.
    
    .. note::

       This API is experimental in IPython 2.0, and may be revised in future versions.
    c�6�||_d�|D��|_dS)aInitialise the :class:`CallbackManager`.

        Parameters
        ----------
        shell
            The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
        available_events
            An iterable of names for callback events.
        c��i|]}|g��S�r)�.0�ns  �5/usr/lib/python3/dist-packages/IPython/core/events.py�
<dictcomp>z)EventManager.__init__.<locals>.<dictcomp>(s��9�9�9�1�!�B�9�9�9�N)�shell�	callbacks)�selfr�available_eventss   r�__init__zEventManager.__init__s%����
�9�9�(8�9�9�9����r
c��t|��std|z���t�|��}||j|vr5|j|�|�|����dSdS)a�Register a new event callback.

        Parameters
        ----------
        event : str
            The event for which to register this callback.
        function : callable
            A function to be called on the given event. It should take the same
            parameters as the appropriate callback prototype.

        Raises
        ------
        TypeError
            If ``function`` is not callable.
        KeyError
            If ``event`` is not one of the known events.
        zNeed a callable, got %rN)�callable�	TypeErrorr�getr�append�adapt)r�event�function�callback_protos    r�registerzEventManager.register*s���$��!�!�	B��5��@�A�A�A�)�-�-�e�4�4���4�>�%�0�0�0��N�5�!�(�(��)=�)=�h�)G�)G�H�H�H�H�H�1�0r
c�>�||j|vr |j|�|��S|j|D]>}	|j|ur"|j|�|��cS�/#t$rY�;wxYwt	d�||�����)z'Remove a callback from the given event.z0Function {!r} is not registered as a {} callback)r�remove�__wrapped__�AttributeError�
ValueError�format)rrr�callbacks    r�
unregisterzEventManager.unregisterBs����t�~�e�,�,�,��>�%�(�/�/��9�9�9���u�-�	�	�H�
��'�8�3�3��>�%�0�7�7��A�A�A�A�A�4��!�
�
�
���
�����K�R�R�S[�]b�c�c�d�d�ds�(A,�,
A9�8A9c���|j|dd�D]^}	||i|���#ttf$r?td�||����|j���Y�[wxYwdS)z�Call callbacks for ``event``.

        Any additional arguments are passed to all callbacks registered for this
        event. Exceptions raised by callbacks are caught, and a message printed.
        NzError in callback {} (for {}):)r�	Exception�KeyboardInterrupt�printr"r�
showtraceback)rr�args�kwargs�funcs     r�triggerzEventManager.triggerQs����N�5�)�!�!�!�,�	+�	+�D�
+���d�%�f�%�%�%�%���0�1�
+�
+�
+��6�=�=�d�E�J�J�K�K�K��
�(�(�*�*�*�*�*�
+����	+�	+s�"�A
A2�1A2N)�__name__�
__module__�__qualname__�__doc__rrr$r-rr
rrrs`��������:�:�:�I�I�I�0
e�
e�
e�+�+�+�+�+r
rc�B�t|��}|t|j<|S)N)rrr.)�callback_functionrs  r�
_define_eventr4as%��'�(9�:�:�N�3A��&�/�0��r
c��dS)z�Fires before code is executed in response to user/frontend action.

    This includes comm and widget messages and silent execution, as well as user
    code cells.
    Nrrr
r�pre_executer6m�	��	�Dr
c��dS)z�Fires before user-entered code runs.

    Parameters
    ----------
    info : :class:`~IPython.core.interactiveshell.ExecutionInfo`
        An object containing information used for the code execution.
    Nr)�infos r�pre_run_cellr:v�	��	�Dr
c��dS)z�Fires after code is executed in response to user/frontend action.

    This includes comm and widget messages and silent execution, as well as user
    code cells.
    Nrrr
r�post_executer=�r7r
c��dS)z�Fires after user-entered code runs.

    Parameters
    ----------
    result : :class:`~IPython.core.interactiveshell.ExecutionResult`
        The object which will be returned as the execution result.
    Nr)�results r�
post_run_cellr@�r;r
c��dS)aKFires after initialisation of :class:`~IPython.core.interactiveshell.InteractiveShell`.

    This is before extensions and startup scripts are loaded, so it can only be
    set by subclassing.

    Parameters
    ----------
    ip : :class:`~IPython.core.interactiveshell.InteractiveShell`
        The newly initialised shell.
    Nr)�ips r�shell_initializedrC�s	��	�Dr
N)r1�backcallr�objectrrr4r6r:r=r@rCrr
r�<module>rFs���
�
�(�'�'�'�'�'�I+�I+�I+�I+�I+�6�I+�I+�I+�X������	�	���	��	�	���	��	�	���	��	�	���	��	�	���	�	�	r

Youez - 2016 - github.com/yon3zu
LinuXploit