o
    éË·e­	  ã                   @   s<   d Z ddlmZ ddlmZmZmZ eG dd„ deƒƒZdS )z?Implementation of magic functions for the extension machinery.
é    )Ú
UsageError)ÚMagicsÚmagics_classÚ
line_magicc                   @   s4   e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZdS )	ÚExtensionMagicsz/Magics to manage the IPython extensions system.c                 C   sX   |st dƒ‚| jj |¡}|dkrtd| ƒ td|ƒ dS |dkr*td| ƒ dS dS )z-Load an IPython extension by its module name.úMissing module name.zalready loadedz6The %s extension is already loaded. To reload it, use:z  %reload_extzno load functionz*The %s module is not an IPython extension.N)r   ÚshellÚextension_managerÚload_extensionÚprint©ÚselfÚ
module_strÚres© r   úT/var/www/ideatree/venv/lib/python3.10/site-packages/IPython/core/magics/extension.pyÚload_ext   s   ÿzExtensionMagics.load_extc                 C   sN   |st dƒ‚| jj |¡}|dkrtd| ƒ dS |dkr%td| ƒ dS dS )z¯Unload an IPython extension by its module name.

        Not all extensions can be unloaded, only those which define an
        ``unload_ipython_extension`` function.
        r   zno unload functionz1The %s extension doesn't define how to unload it.z
not loadedzThe %s extension is not loaded.N)r   r   r	   Úunload_extensionr   r   r   r   r   Ú
unload_ext)   s   ÿzExtensionMagics.unload_extc                 C   s   |st dƒ‚| jj |¡ dS )z/Reload an IPython extension by its module name.r   N)r   r   r	   Úreload_extension)r   r   r   r   r   Ú
reload_ext:   s   zExtensionMagics.reload_extN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s    

r   N)r   ÚIPython.core.errorr   ÚIPython.core.magicr   r   r   r   r   r   r   r   Ú<module>   s
    