Show More
@@ -7,13 +7,12 b'' | |||
|
7 | 7 | import os |
|
8 | 8 | import os.path |
|
9 | 9 | import warnings |
|
10 | import textwrap | |
|
11 | 10 | from shutil import copyfile |
|
12 | 11 | import sys |
|
13 | 12 | from importlib import import_module |
|
14 | 13 | |
|
15 | 14 | from traitlets.config.configurable import Configurable |
|
16 | from IPython.utils.path import ensure_dir_exists | |
|
15 | from IPython.utils.path import ensure_dir_exists, compress_user | |
|
17 | 16 | from traitlets import Instance |
|
18 | 17 | |
|
19 | 18 | try: |
@@ -86,26 +85,10 b' class ExtensionManager(Configurable):' | |||
|
86 | 85 | with prepended_to_syspath(self.ipython_extension_dir): |
|
87 | 86 | mod = import_module(module_str) |
|
88 | 87 | if mod.__file__.startswith(self.ipython_extension_dir): |
|
89 | print(textwrap.dedent( | |
|
90 | """ | |
|
91 | Warning, you are attempting to load and IPython extensions from legacy | |
|
92 | location. | |
|
93 | ||
|
94 | IPythonhas been requested to load extension `{ext}` which has been found in | |
|
95 | `ipython_extension_dir` (`{dir}`). | |
|
96 | ||
|
97 | It is likely you previously installed an extension using the `%install_ext` | |
|
98 | mechanism which has been deprecated since IPython 4.0. Loading extensions | |
|
99 | from the above directory is still supported but will be deprecated in a | |
|
100 | future version of IPython. | |
|
101 | ||
|
102 | Extensions should now be installed and managed as Python packages. We | |
|
103 | recommend you update your extensions accordingly. | |
|
104 | ||
|
105 | Old extensions files present in `ipython_extension_dir` may cause newly | |
|
106 | installed extensions to not be recognized. Thus you may need to clean | |
|
107 | the content of above mentioned directory. | |
|
108 | """.format(dir=self.ipython_extension_dir, ext=module_str))) | |
|
88 | print(("Loading extensions from {dir} is deprecated. " | |
|
89 | "We recommend managing extensions like any " | |
|
90 | "other Python packages, in site-packages.").format( | |
|
91 | dir=compress_user(self.ipython_extension_dir))) | |
|
109 | 92 | mod = sys.modules[module_str] |
|
110 | 93 | if self._call_load_ipython_extension(mod): |
|
111 | 94 | self.loaded.add(module_str) |
General Comments 0
You need to be logged in to leave comments.
Login now