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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/IPython/core/__pycache__/hooks.cpython-312.pyc
�

}�e��t�dZddlZddlZddlZddlmZgd�Zdddd	�Zdd
�Zd�Z	Gd�d
�Z
d�Zd�Zd�Z
y)a�Hooks for IPython.

In Python, it is possible to overwrite any method of any object if you really
want to.  But IPython exposes a few 'hooks', methods which are *designed* to
be overwritten by users for customization purposes.  This module defines the
default versions of all such hooks, which get used by IPython if not
overridden by the user.

Hooks are simple functions, but they should be declared with ``self`` as their
first argument, because when activated they are registered into IPython as
instance methods. The self argument will be the IPython running instance
itself, so hooks have full access to the entire IPython object.

If you wish to define a new hook and activate it, you can make an :doc:`extension
</config/extensions/index>` or a :ref:`startup script <startup_files>`. For
example, you could use a startup file like this::

    import os

    def calljed(self,filename, linenum):
        "My editor hook calls the jed editor directly."
        print "Calling my own editor, jed ..."
        if os.system('jed +%d %s' % (linenum,filename)) != 0:
            raise TryNext()

    def load_ipython_extension(ip):
        ip.set_hook('editor', calljed)

�N���TryNext)�editor�synchronize_with_editor�
show_in_pager�pre_prompt_hook�
clipboard_getz8a callback for the 'pre_execute' or 'pre_run_cell' eventz,a callback for the 'shell_initialized' eventzthe atexit module)�pre_run_code_hook�late_startup_hook�
shutdown_hookc�*�|j}|�|dk(rd}ndt|�z}d|vr,tjj	|�r
|ddk7rd|z}tj|�d|�d|��d	�
�}|r|j�dk7r
t��yy)aOpen the default editor at the given filename and linenumber.

    This is IPython's default editor hook, you can use it as an example to
    write your own modified one.  To set your own editor function as the
    new editor hook, call ip.set_hook('editor',yourfunc).N�notepad�z+%d� r�"z"%s"T)�shell)	r�int�os�path�isfile�
subprocess�Popen�waitr)�self�filename�linenumrr�linemark�procs       �4/usr/lib/python3/dist-packages/IPython/core/hooks.pyrr<s����[�[�F���&�)�+����3�w�<�'���f�}�������/�F�1�I��4D��&������&�(�H�E�"&�(�D���	�	��q� ��i��!�t�c��y�N�)rrr�columns    r rrXs��r!c�2�eZdZdZdd�Zd�Zd�Zd	d�Zd�Zy)
�CommandChainDispatcherz� Dispatch calls to a chain of commands until some func can handle it

    Usage: instantiate, execute "add" to add commands (with optional
    priority), execute normally via f() calling mechanism.

    Nc�&�|�g|_y||_yr#)�chain)r�commandss  r �__init__zCommandChainDispatcher.__init__cs�����D�J�!�D�Jr!c��t�}|jD]\}}	||i|��cS|�#t$r}|}Yd}~�$d}~wwxYw)z� Command chain is called just like normal func.

        This will call all funcs in chain with the same args as were given to
        this function, and return the result of first func that didn't raise
        TryNextN)rr))r�args�kw�last_exc�prio�cmd�excs       r �__call__zCommandChainDispatcher.__call__jsU���9���
�
�	�H�D��
��D�'�B�'�'�	�����
����
�s�+�	A�;�Ac�,�t|j�Sr#)�strr)�rs r �__str__zCommandChainDispatcher.__str__zs���4�:�:��r!c�x�|jj||f�|jjd���y)z1 Add a func to the cmd chain with given priority c��|dS)Nrr$)�xs r �<lambda>z,CommandChainDispatcher.add.<locals>.<lambda>�s
��a��d�r!)�keyN)r)�append�sort)r�func�prioritys   r �addzCommandChainDispatcher.add}s+���
�
���8�T�*�+��
�
���N��+r!c�,�t|j�S)zV Return all objects in chain.

        Handy if the objects are not callable.
        )�iterr)r6s r �__iter__zCommandChainDispatcher.__iter__�s��
�D�J�J��r!r#)r)	�__name__�
__module__�__qualname__�__doc__r+r3r7rArDr$r!r r'r'\s ���"�� �,�
 r!r'c��t�)z Run a string through pager r)r�data�start�screen_liness    r rr�s	���Mr!c��y)z� Run before displaying the next prompt

    Use this e.g. to display output from asynchronous operations (in order
    to not mess up text entry)
    Nr$r6s r r	r	�s��r!c���ddlm}m}m}m}t
jdk(r||g}nt
jdk(r||g}n||g}t�}|D]}|j|��|�}|S)z" Get text from the clipboard.
    �)�osx_clipboard_get�tkinter_clipboard_get�win32_clipboard_get�wayland_clipboard_get�win32�darwin)	�
lib.clipboardrPrQrRrS�sys�platformr'rA)	rrPrQrRrSr)�
dispatcherr?�texts	         r r
r
�sv�����|�|�w��$�&;�<��	����	!�"�$9�:��&�(=�>��'�)�J�������t����<�D��Kr!)NT)rHrrrW�errorr�__all__�
deprecatedrrr'rr	r
r$r!r �<module>r^sW���J
��
��
��$^�#Q�2��
�
�8
�+ �+ �\��r!

Youez - 2016 - github.com/yon3zu
LinuXploit