Show More
@@ -131,7 +131,7 b' class BaseIPythonApplication(Application):' | |||
|
131 | 131 | help=""" |
|
132 | 132 | The name of the IPython directory. This directory is used for logging |
|
133 | 133 | configuration (through profiles), history storage, etc. The default |
|
134 |
is usually $HOME/.ipython. This option |
|
|
134 | is usually $HOME/.ipython. This option can also be specified through | |
|
135 | 135 | the environment variable IPYTHONDIR. |
|
136 | 136 | """ |
|
137 | 137 | ) |
@@ -6,7 +6,9 b' import errno' | |||
|
6 | 6 | import os.path |
|
7 | 7 | |
|
8 | 8 | from IPython.config.application import Application |
|
9 |
from IPython.core.application import |
|
|
9 | from IPython.core.application import ( | |
|
10 | BaseIPythonApplication, base_flags, base_aliases | |
|
11 | ) | |
|
10 | 12 | from IPython.utils.traitlets import Instance, Dict, Unicode, Bool |
|
11 | 13 | |
|
12 | 14 | from .kernelspec import KernelSpecManager |
@@ -21,6 +23,10 b' class ListKernelSpecs(BaseIPythonApplication):' | |||
|
21 | 23 | description = """List installed kernel specifications.""" |
|
22 | 24 | kernel_spec_manager = Instance(KernelSpecManager) |
|
23 | 25 | |
|
26 | # Not all of the base aliases are meaningful (e.g. profile) | |
|
27 | aliases = {k: base_aliases[k] for k in ['ipython-dir', 'log-level']} | |
|
28 | flags = {'debug': base_flags['debug'],} | |
|
29 | ||
|
24 | 30 | def _kernel_spec_manager_default(self): |
|
25 | 31 | return KernelSpecManager(ipython_dir=self.ipython_dir) |
|
26 | 32 | |
@@ -56,13 +62,15 b' class InstallKernelSpec(BaseIPythonApplication):' | |||
|
56 | 62 | ) |
|
57 | 63 | |
|
58 | 64 | aliases = {'name': 'InstallKernelSpec.kernel_name'} |
|
65 | for k in ['ipython-dir', 'log-level']: | |
|
66 | aliases[k] = base_aliases[k] | |
|
59 | 67 | |
|
60 | 68 | flags = {'system': ({'InstallKernelSpec': {'system': True}}, |
|
61 | 69 | "Install to the systemwide kernel registry"), |
|
62 | 70 | 'replace': ({'InstallKernelSpec': {'replace': True}}, |
|
63 | 71 | "Replace any existing kernel spec with this name."), |
|
72 | 'debug': base_flags['debug'], | |
|
64 | 73 | } |
|
65 | flags.update(base_flags) | |
|
66 | 74 | |
|
67 | 75 | def parse_command_line(self, argv): |
|
68 | 76 | super(InstallKernelSpec, self).parse_command_line(argv) |
@@ -98,6 +106,9 b' class KernelSpecApp(Application):' | |||
|
98 | 106 | install = (InstallKernelSpec, InstallKernelSpec.description.splitlines()[0]) |
|
99 | 107 | )) |
|
100 | 108 | |
|
109 | aliases = {} | |
|
110 | flags = {} | |
|
111 | ||
|
101 | 112 | def start(self): |
|
102 | 113 | if self.subapp is None: |
|
103 | 114 | print("No subcommand specified. Must specify one of: %s"% list(self.subcommands)) |
General Comments 0
You need to be logged in to leave comments.
Login now