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 |
@@ -20,6 +22,10 b' def _pythonfirst(s):' | |||
|
20 | 22 | class ListKernelSpecs(BaseIPythonApplication): |
|
21 | 23 | description = """List installed kernel specifications.""" |
|
22 | 24 | kernel_spec_manager = Instance(KernelSpecManager) |
|
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'],} | |
|
23 | 29 | |
|
24 | 30 | def _kernel_spec_manager_default(self): |
|
25 | 31 | return KernelSpecManager(ipython_dir=self.ipython_dir) |
@@ -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) |
@@ -97,6 +105,9 b' class KernelSpecApp(Application):' | |||
|
97 | 105 | list = (ListKernelSpecs, ListKernelSpecs.description.splitlines()[0]), |
|
98 | 106 | install = (InstallKernelSpec, InstallKernelSpec.description.splitlines()[0]) |
|
99 | 107 | )) |
|
108 | ||
|
109 | aliases = {} | |
|
110 | flags = {} | |
|
100 | 111 | |
|
101 | 112 | def start(self): |
|
102 | 113 | if self.subapp is None: |
General Comments 0
You need to be logged in to leave comments.
Login now