Show More
@@ -0,0 +1,1 b'' | |||
|
1 | Deleted the install_ext magic function |
@@ -30,35 +30,6 b' class ExtensionMagics(Magics):' | |||
|
30 | 30 | """Magics to manage the IPython extensions system.""" |
|
31 | 31 | |
|
32 | 32 | @line_magic |
|
33 | def install_ext(self, parameter_s=''): | |
|
34 | """Download and install an extension from a URL, e.g.:: | |
|
35 | ||
|
36 | %install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/d1310a2ab15d/physics.py | |
|
37 | ||
|
38 | The URL should point to an importable Python module - either a .py file | |
|
39 | or a .zip file. | |
|
40 | ||
|
41 | Parameters: | |
|
42 | ||
|
43 | -n filename : Specify a name for the file, rather than taking it from | |
|
44 | the URL. | |
|
45 | """ | |
|
46 | warn("%install_ext` is deprecated, please distribute your extension " | |
|
47 | "as a python package.", UserWarning) | |
|
48 | opts, args = self.parse_options(parameter_s, 'n:') | |
|
49 | try: | |
|
50 | filename = self.shell.extension_manager.install_extension(args, | |
|
51 | opts.get('n')) | |
|
52 | except ValueError as e: | |
|
53 | print(e) | |
|
54 | return | |
|
55 | ||
|
56 | filename = os.path.basename(filename) | |
|
57 | print("Installed %s. To use it, type:" % filename) | |
|
58 | print(" %%load_ext %s" % os.path.splitext(filename)[0]) | |
|
59 | ||
|
60 | ||
|
61 | @line_magic | |
|
62 | 33 | def load_ext(self, module_str): |
|
63 | 34 | """Load an IPython extension by its module name.""" |
|
64 | 35 | if not module_str: |
General Comments 0
You need to be logged in to leave comments.
Login now