| 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 : |
�
}�e� � � � d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ ddd �Z G d
� de� Zy)z(A class for managing IPython extensions.� N)�
import_module�reload)�Configurable)�ensure_dir_exists�
compress_user)�undoc)�InstanceF)�
storemagic�
autoreloadc � � � e Zd ZdZ edd�� Zd� fd� Zed� � Zd� Z de
fd �Zde
fd
�Zde
fd�Z
de
fd�Zd
� Zd� Z� xZS )�ExtensionManagerar A 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_nonec � �� t t | �
dd|i|�� | j j | j
d�� t
� | _ y )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.pyr zExtensionManager.__init__6 sI �� �
���.�E�U�E�f�E��
�
����(�(�0@� �
� �e��� c �j � t j j | j j d� S )N�
extensions)�os�path�joinr r )r s r �ipython_extension_dirz&ExtensionManager.ipython_extension_dir= s! � ��w�w�|�|�D�J�J�2�2�M�B�Br c �. � t | j � y �N)r r$ )r �changes r r z(ExtensionManager._on_ipython_dir_changedA s � ��$�4�4�5r �
module_strc � � | j |� S # t $ r) |t v rdt |<