
    f	                     H    d Z ddlmZ ddlmZmZmZ e G d de             Zy)z?Implementation of magic functions for the extension machinery.
    )
UsageError)Magicsmagics_class
line_magicc                   @    e Zd ZdZed        Zed        Zed        Zy)ExtensionMagicsz/Magics to manage the IPython extensions system.c                     |st        d      | j                  j                  j                  |      }|dk(  rt	        d|z         t	        d|       y|dk(  rt	        d|z         yy)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ress      X/var/www/cvtools/html/venv/lib/python3.12/site-packages/IPython/core/magics/extension.pyload_extzExtensionMagics.load_ext   sj     344jj**99*E""JZWX/:.&&>KL '    c                     |st        d      | j                  j                  j                  |      }|dk(  rt	        d|z         y|dk(  rt	        d|z         yy)zUnload 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   s      r   
unload_extzExtensionMagics.unload_ext)   s_     344jj**;;JG&&E
RSL 3j@A !r   c                 h    |st        d      | j                  j                  j                  |       y)z/Reload an IPython extension by its module name.r
   N)r   r   r   reload_extension)r   r   s     r   
reload_extzExtensionMagics.reload_ext:   s+     344

$$55jAr   N)__name__
__module____qualname____doc__r   r   r   r    r   r   r   r      sE    9
M 
M B B  B Br   r   N)r   IPython.core.errorr   IPython.core.magicr   r   r   r   r    r   r   <module>r#      s3     * ? ? &Bf &B &Br   