##// END OF EJS Templates
Don't blend kernel and frontend CLI args...
Min RK -
Show More
@@ -18,20 +18,13 b' from IPython.config.application import boolean_flag'
18 18 from IPython.core.profiledir import ProfileDir
19 19 from IPython.kernel.blocking import BlockingKernelClient
20 20 from IPython.kernel import KernelManager
21 from IPython.kernel import tunnel_to_kernel, find_connection_file, swallow_argv
21 from IPython.kernel import tunnel_to_kernel, find_connection_file
22 22 from IPython.kernel.kernelspec import NoSuchKernel
23 23 from IPython.utils.path import filefind
24 24 from IPython.utils.traitlets import (
25 25 Dict, List, Unicode, CUnicode, CBool, Any
26 26 )
27 from IPython.kernel.zmq.kernelapp import (
28 kernel_flags,
29 kernel_aliases,
30 IPKernelApp
31 )
32 from IPython.kernel.zmq.pylab.config import InlineBackend
33 27 from IPython.kernel.zmq.session import Session
34 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
35 28 from IPython.kernel.connect import ConnectionFileMixin
36 29
37 30 from IPython.utils.localinterfaces import localhost
@@ -40,7 +33,7 b' from IPython.utils.localinterfaces import localhost'
40 33 # Aliases and Flags
41 34 #-----------------------------------------------------------------------------
42 35
43 flags = dict(kernel_flags)
36 flags = {}
44 37
45 38 # the flags that are specific to the frontend
46 39 # these must be scrubbed before being passed to the kernel,
@@ -60,7 +53,7 b' app_flags.update(boolean_flag('
60 53 ))
61 54 flags.update(app_flags)
62 55
63 aliases = dict(kernel_aliases)
56 aliases = {}
64 57
65 58 # also scrub aliases from the frontend
66 59 app_aliases = dict(
@@ -140,19 +133,12 b' class IPythonConsoleApp(ConnectionFileMixin):'
140 133 to force a direct exit without any confirmation.""",
141 134 )
142 135
143 @property
144 def help_classes(self):
145 """ConsoleApps can configure kernels on the command-line
136 def build_kernel_argv(self, argv=None):
137 """build argv to be passed to kernel subprocess
146 138
147 But this shouldn't be written to a file
139 Override in subclasses if any args should be passed to the kernel
148 140 """
149 return self.classes + [IPKernelApp] + IPKernelApp.classes
150
151 def build_kernel_argv(self, argv=None):
152 """build argv to be passed to kernel subprocess"""
153 if argv is None:
154 argv = sys.argv[1:]
155 self.kernel_argv = swallow_argv(argv, self.frontend_aliases, self.frontend_flags)
141 self.kernel_argv = self.extra_args
156 142
157 143 def init_connection_file(self):
158 144 """find the connection file, and load the info if found.
@@ -3,25 +3,10 b''
3 3 """
4 4 The :class:`~IPython.core.application.Application` object for the command
5 5 line :command:`ipython` program.
6
7 Authors
8 -------
9
10 * Brian Granger
11 * Fernando Perez
12 * Min Ragan-Kelley
13 6 """
14 7
15 #-----------------------------------------------------------------------------
16 # Copyright (C) 2008-2011 The IPython Development Team
17 #
18 # Distributed under the terms of the BSD License. The full license is in
19 # the file COPYING, distributed as part of this software.
20 #-----------------------------------------------------------------------------
21
22 #-----------------------------------------------------------------------------
23 # Imports
24 #-----------------------------------------------------------------------------
8 # Copyright (c) IPython Development Team.
9 # Distributed under the terms of the Modified BSD License.
25 10
26 11 from __future__ import absolute_import
27 12 from __future__ import print_function
@@ -2,17 +2,11 b''
2 2
3 3 This is not a complete console app, as subprocess will not be able to receive
4 4 input, there is no real readline support, among other limitations.
5
6 Authors:
7
8 * Min RK
9 * Paul Ivanov
10
11 5 """
12 6
13 #-----------------------------------------------------------------------------
14 # Imports
15 #-----------------------------------------------------------------------------
7 # Copyright (c) IPython Development Team.
8 # Distributed under the terms of the Modified BSD License.
9
16 10 import signal
17 11
18 12 from IPython.terminal.ipapp import TerminalIPythonApp, frontend_flags as term_flags
@@ -99,9 +93,11 b' class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonConsoleApp):'
99 93
100 94 subcommands = Dict()
101 95
96 force_interact = True
97
102 98 def parse_command_line(self, argv=None):
103 99 super(ZMQTerminalIPythonApp, self).parse_command_line(argv)
104 self.build_kernel_argv(argv)
100 self.build_kernel_argv(self.extra_args)
105 101
106 102 def init_shell(self):
107 103 IPythonConsoleApp.initialize(self)
@@ -7,11 +7,6 b' input, there is no real readline support, among other limitations.'
7 7 # Copyright (c) IPython Development Team.
8 8 # Distributed under the terms of the Modified BSD License.
9 9
10 #-----------------------------------------------------------------------------
11 # Imports
12 #-----------------------------------------------------------------------------
13
14 # stdlib imports
15 10 import os
16 11 import signal
17 12 import sys
@@ -46,10 +41,8 b" if os.name == 'nt':"
46 41
47 42 sys.excepthook = gui_excepthook
48 43
49 # System library imports
50 44 from IPython.external.qt import QtCore, QtGui
51 45
52 # Local imports
53 46 from IPython.config.application import boolean_flag
54 47 from IPython.config.application import catch_config_error
55 48 from IPython.core.application import BaseIPythonApplication
@@ -191,7 +184,7 b' class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):'
191 184
192 185 def parse_command_line(self, argv=None):
193 186 super(IPythonQtConsoleApp, self).parse_command_line(argv)
194 self.build_kernel_argv(argv)
187 self.build_kernel_argv(self.extra_args)
195 188
196 189
197 190 def new_frontend_master(self):
General Comments 0
You need to be logged in to leave comments. Login now