##// END OF EJS Templates
Much shorter deprecation message
Thomas Kluyver -
Show More
@@ -7,13 +7,12 b''
7 import os
7 import os
8 import os.path
8 import os.path
9 import warnings
9 import warnings
10 import textwrap
11 from shutil import copyfile
10 from shutil import copyfile
12 import sys
11 import sys
13 from importlib import import_module
12 from importlib import import_module
14
13
15 from traitlets.config.configurable import Configurable
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 from traitlets import Instance
16 from traitlets import Instance
18
17
19 try:
18 try:
@@ -86,26 +85,10 b' class ExtensionManager(Configurable):'
86 with prepended_to_syspath(self.ipython_extension_dir):
85 with prepended_to_syspath(self.ipython_extension_dir):
87 mod = import_module(module_str)
86 mod = import_module(module_str)
88 if mod.__file__.startswith(self.ipython_extension_dir):
87 if mod.__file__.startswith(self.ipython_extension_dir):
89 print(textwrap.dedent(
88 print(("Loading extensions from {dir} is deprecated. "
90 """
89 "We recommend managing extensions like any "
91 Warning, you are attempting to load and IPython extensions from legacy
90 "other Python packages, in site-packages.").format(
92 location.
91 dir=compress_user(self.ipython_extension_dir)))
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)))
109 mod = sys.modules[module_str]
92 mod = sys.modules[module_str]
110 if self._call_load_ipython_extension(mod):
93 if self._call_load_ipython_extension(mod):
111 self.loaded.add(module_str)
94 self.loaded.add(module_str)
General Comments 0
You need to be logged in to leave comments. Login now