Format: application/x-python-code
1 o
2
3 ��h� � @ sn d Z ddlZddlZddlZddlmZmZ ddlmZ ddl m
4 Z
5 ddlmZ ddd�Z
6 G d d
7 � d
8 e�ZdS )z(A class for managing IPython extensions.� N)�
9 import_module�reload)�Configurable)�ensure_dir_exists)�InstanceF)Z
10 storemagicZ
11 autoreloadc sv e Zd ZdZeddd�Zd� fdd� Zdefd d
12 �Zdefdd�Z defd
13 d�Z
14 defdd�Zdd� Zdd� Z
15 � ZS )�ExtensionManagera� A class to manage IPython extensions.
16
17 An IPython extension is an importable Python module that has
18 a function with the signature::
19
20 def load_ipython_extension(ipython):
21 # Do things with ipython
22
23 This function is called after your extension is imported and the
24 currently active :class:`InteractiveShell` instance is passed as
25 the only argument. You can do anything you want with IPython at
26 that point, including defining new magic and aliases, adding new
27 components, etc.
28
29 You can also optionally define an :func:`unload_ipython_extension(ipython)`
30 function, which will be called if the user unloads or reloads the extension.
31 The extension manager will only call :func:`load_ipython_extension` again
32 if the extension is reloaded.
33
34 You can put your extension modules anywhere you want, as long as
35 they can be imported by Python's standard import mechanism.
36 z1IPython.core.interactiveshell.InteractiveShellABCT)�
37 allow_noneNc s&