Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/extensions.cpython-39.pyc
Ðазад
a o�h� � @ s~ d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m Z mZ ddlm Z ddlmZ ddd �ZG d d� de�ZdS )z(A class for managing IPython extensions.� N)� import_module�reload)�Configurable)�ensure_dir_exists� compress_user)�undoc)�InstanceF)Z storemagicZ autoreloadc s� e Zd ZdZeddd�Zd� fdd� Zedd � �Zd d� Z e d�d d�Ze d�dd�Ze d�dd�Z e d�dd�Zdd� Zdd� Z� ZS )�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_noneNc s8 t t| �jf d|i|�� | jj| jdd� t� | _d S )N�shell)�ipython_dir)�names)�superr �__init__r Zobserve�_on_ipython_dir_changed�set�loaded)�selfr �kwargs�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/core/extensions.pyr 6 s �zExtensionManager.__init__c C s t j�| jjd�S )N� extensions)�os�path�joinr r )r r r r �ipython_extension_dir= s z&ExtensionManager.ipython_extension_dirc C s t | j� d S )N)r r )r Zchanger r r r A s z(ExtensionManager._on_ipython_dir_changed)� module_strc C sH z| � |�W S tyB |tv r<dt|<