Show More
@@ -88,13 +88,7 b' class ExtensionManager(Configurable):' | |||||
88 |
|
88 | |||
89 | with self.shell.builtin_trap: |
|
89 | with self.shell.builtin_trap: | |
90 | if module_str not in sys.modules: |
|
90 | if module_str not in sys.modules: | |
91 | with prepended_to_syspath(self.ipython_extension_dir): |
|
91 | mod = import_module(module_str) | |
92 | mod = import_module(module_str) |
|
|||
93 | if mod.__file__.startswith(self.ipython_extension_dir): |
|
|||
94 | print(("Loading extensions from {dir} is deprecated. " |
|
|||
95 | "We recommend managing extensions like any " |
|
|||
96 | "other Python packages, in site-packages.").format( |
|
|||
97 | dir=compress_user(self.ipython_extension_dir))) |
|
|||
98 | mod = sys.modules[module_str] |
|
92 | mod = sys.modules[module_str] | |
99 | if self._call_load_ipython_extension(mod): |
|
93 | if self._call_load_ipython_extension(mod): | |
100 | self.loaded.add(module_str) |
|
94 | self.loaded.add(module_str) | |
@@ -155,13 +149,3 b' class ExtensionManager(Configurable):' | |||||
155 | if hasattr(mod, 'unload_ipython_extension'): |
|
149 | if hasattr(mod, 'unload_ipython_extension'): | |
156 | mod.unload_ipython_extension(self.shell) |
|
150 | mod.unload_ipython_extension(self.shell) | |
157 | return True |
|
151 | return True | |
158 |
|
||||
159 | @undoc |
|
|||
160 | def install_extension(self, url, filename=None): |
|
|||
161 | """ |
|
|||
162 | Deprecated. |
|
|||
163 | """ |
|
|||
164 | # Ensure the extension directory exists |
|
|||
165 | raise DeprecationWarning( |
|
|||
166 | '`install_extension` and the `install_ext` magic have been deprecated since IPython 4.0' |
|
|||
167 | 'Use pip or other package managers to manage ipython extensions.') |
|
@@ -6,8 +6,7 b' IPython extensions' | |||||
6 |
|
6 | |||
7 | A level above configuration are IPython extensions, Python modules which modify |
|
7 | A level above configuration are IPython extensions, Python modules which modify | |
8 | the behaviour of the shell. They are referred to by an importable module name, |
|
8 | the behaviour of the shell. They are referred to by an importable module name, | |
9 |
and can be placed anywhere you'd normally import from |
|
9 | and can be placed anywhere you'd normally import from. | |
10 | ``.ipython/extensions/``. |
|
|||
11 |
|
10 | |||
12 | Getting extensions |
|
11 | Getting extensions | |
13 | ================== |
|
12 | ================== | |
@@ -71,10 +70,7 b' Useful :class:`InteractiveShell` methods include :meth:`~IPython.core.interactiv' | |||||
71 | :ref:`defining_magics` |
|
70 | :ref:`defining_magics` | |
72 |
|
71 | |||
73 | You can put your extension modules anywhere you want, as long as they can be |
|
72 | You can put your extension modules anywhere you want, as long as they can be | |
74 |
imported by Python's standard import mechanism. |
|
73 | imported by Python's standard import mechanism. | |
75 | write extensions, you can also put your extensions in :file:`extensions/` |
|
|||
76 | within the :ref:`IPython directory <ipythondir>`. This directory is |
|
|||
77 | added to :data:`sys.path` automatically. |
|
|||
78 |
|
74 | |||
79 | When your extension is ready for general use, please add it to the `extensions |
|
75 | When your extension is ready for general use, please add it to the `extensions | |
80 | index <https://github.com/ipython/ipython/wiki/Extensions-Index>`_. We also |
|
76 | index <https://github.com/ipython/ipython/wiki/Extensions-Index>`_. We also |
General Comments 0
You need to be logged in to leave comments.
Login now