Show More
@@ -69,11 +69,11 b' flags = dict(ipkernel_flags)' | |||||
69 | # these must be scrubbed before being passed to the kernel, |
|
69 | # these must be scrubbed before being passed to the kernel, | |
70 | # or it will raise an error on unrecognized flags |
|
70 | # or it will raise an error on unrecognized flags | |
71 | app_flags = { |
|
71 | app_flags = { | |
72 |
'existing' : ({'IPython |
|
72 | 'existing' : ({'IPythonConsoleApp' : {'existing' : 'kernel*.json'}}, | |
73 | "Connect to an existing kernel. If no argument specified, guess most recent"), |
|
73 | "Connect to an existing kernel. If no argument specified, guess most recent"), | |
74 | } |
|
74 | } | |
75 | app_flags.update(boolean_flag( |
|
75 | app_flags.update(boolean_flag( | |
76 |
'confirm-exit', 'IPython |
|
76 | 'confirm-exit', 'IPythonConsoleApp.confirm_exit', | |
77 | """Set to display confirmation dialog on exit. You can always use 'exit' or 'quit', |
|
77 | """Set to display confirmation dialog on exit. You can always use 'exit' or 'quit', | |
78 | to force a direct exit without any confirmation. |
|
78 | to force a direct exit without any confirmation. | |
79 | """, |
|
79 | """, | |
@@ -87,16 +87,16 b' aliases = dict(ipkernel_aliases)' | |||||
87 |
|
87 | |||
88 | # also scrub aliases from the frontend |
|
88 | # also scrub aliases from the frontend | |
89 | app_aliases = dict( |
|
89 | app_aliases = dict( | |
90 |
hb = 'IPython |
|
90 | hb = 'IPythonConsoleApp.hb_port', | |
91 |
shell = 'IPython |
|
91 | shell = 'IPythonConsoleApp.shell_port', | |
92 |
iopub = 'IPython |
|
92 | iopub = 'IPythonConsoleApp.iopub_port', | |
93 |
stdin = 'IPython |
|
93 | stdin = 'IPythonConsoleApp.stdin_port', | |
94 |
ip = 'IPython |
|
94 | ip = 'IPythonConsoleApp.ip', | |
95 |
existing = 'IPython |
|
95 | existing = 'IPythonConsoleApp.existing', | |
96 |
f = 'IPython |
|
96 | f = 'IPythonConsoleApp.connection_file', | |
97 |
|
97 | |||
98 |
|
98 | |||
99 |
ssh = 'IPython |
|
99 | ssh = 'IPythonConsoleApp.sshserver', | |
100 | ) |
|
100 | ) | |
101 | aliases.update(app_aliases) |
|
101 | aliases.update(app_aliases) | |
102 |
|
102 | |||
@@ -105,11 +105,11 b' aliases.update(app_aliases)' | |||||
105 | #----------------------------------------------------------------------------- |
|
105 | #----------------------------------------------------------------------------- | |
106 |
|
106 | |||
107 | #----------------------------------------------------------------------------- |
|
107 | #----------------------------------------------------------------------------- | |
108 |
# IPython |
|
108 | # IPythonConsole | |
109 | #----------------------------------------------------------------------------- |
|
109 | #----------------------------------------------------------------------------- | |
110 |
|
110 | |||
111 |
|
111 | |||
112 |
class IPython |
|
112 | class IPythonConsoleApp(Configurable): | |
113 | name = 'ipython-console-mixin' |
|
113 | name = 'ipython-console-mixin' | |
114 | default_config_file_name='ipython_config.py' |
|
114 | default_config_file_name='ipython_config.py' | |
115 |
|
115 | |||
@@ -372,7 +372,7 b' class IPythonMixinConsoleApp(Configurable):' | |||||
372 | def initialize(self, argv=None): |
|
372 | def initialize(self, argv=None): | |
373 | """ |
|
373 | """ | |
374 | Classes which mix this class in should call: |
|
374 | Classes which mix this class in should call: | |
375 |
IPython |
|
375 | IPythonConsoleApp.initialize(self,argv) | |
376 | """ |
|
376 | """ | |
377 | self.init_connection_file() |
|
377 | self.init_connection_file() | |
378 | default_secure(self.config) |
|
378 | default_secure(self.config) |
@@ -49,8 +49,8 b' from IPython.zmq.ipkernel import IPKernelApp' | |||||
49 | from IPython.zmq.session import Session, default_secure |
|
49 | from IPython.zmq.session import Session, default_secure | |
50 | from IPython.zmq.zmqshell import ZMQInteractiveShell |
|
50 | from IPython.zmq.zmqshell import ZMQInteractiveShell | |
51 |
|
51 | |||
52 |
from IPython.frontend. |
|
52 | from IPython.frontend.consoleapp import ( | |
53 |
IPython |
|
53 | IPythonConsoleApp, app_aliases, app_flags, flags, aliases | |
54 | ) |
|
54 | ) | |
55 |
|
55 | |||
56 | #----------------------------------------------------------------------------- |
|
56 | #----------------------------------------------------------------------------- | |
@@ -121,7 +121,7 b' qt_flags = set(qt_flags.keys())' | |||||
121 | #----------------------------------------------------------------------------- |
|
121 | #----------------------------------------------------------------------------- | |
122 |
|
122 | |||
123 |
|
123 | |||
124 |
class IPythonQtConsoleApp(BaseIPythonApplication, IPython |
|
124 | class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp): | |
125 | name = 'ipython-qtconsole' |
|
125 | name = 'ipython-qtconsole' | |
126 |
|
126 | |||
127 | description = """ |
|
127 | description = """ | |
@@ -323,7 +323,7 b' class IPythonQtConsoleApp(BaseIPythonApplication, IPythonMixinConsoleApp):' | |||||
323 | @catch_config_error |
|
323 | @catch_config_error | |
324 | def initialize(self, argv=None): |
|
324 | def initialize(self, argv=None): | |
325 | super(IPythonQtConsoleApp, self).initialize(argv) |
|
325 | super(IPythonQtConsoleApp, self).initialize(argv) | |
326 |
IPython |
|
326 | IPythonConsoleApp.initialize(self,argv) | |
327 | self.init_qt_elements() |
|
327 | self.init_qt_elements() | |
328 | self.init_colors() |
|
328 | self.init_colors() | |
329 | self.init_signal() |
|
329 | self.init_signal() |
@@ -27,8 +27,8 b' from IPython.utils.warn import warn,error' | |||||
27 | from IPython.zmq.ipkernel import IPKernelApp |
|
27 | from IPython.zmq.ipkernel import IPKernelApp | |
28 | from IPython.zmq.session import Session, default_secure |
|
28 | from IPython.zmq.session import Session, default_secure | |
29 | from IPython.zmq.zmqshell import ZMQInteractiveShell |
|
29 | from IPython.zmq.zmqshell import ZMQInteractiveShell | |
30 |
from IPython.frontend. |
|
30 | from IPython.frontend.consoleapp import ( | |
31 |
IPython |
|
31 | IPythonConsoleApp, app_aliases, app_flags, aliases, app_aliases, flags | |
32 | ) |
|
32 | ) | |
33 |
|
33 | |||
34 | from IPython.frontend.terminal.console.interactiveshell import ZMQTerminalInteractiveShell |
|
34 | from IPython.frontend.terminal.console.interactiveshell import ZMQTerminalInteractiveShell | |
@@ -77,7 +77,7 b' frontend_flags = set(frontend_flags.keys())' | |||||
77 | #----------------------------------------------------------------------------- |
|
77 | #----------------------------------------------------------------------------- | |
78 |
|
78 | |||
79 |
|
79 | |||
80 |
class ZMQTerminalIPythonApp(TerminalIPythonApp, IPython |
|
80 | class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonConsoleApp): | |
81 | name = "ipython-console" |
|
81 | name = "ipython-console" | |
82 | """Start a terminal frontend to the IPython zmq kernel.""" |
|
82 | """Start a terminal frontend to the IPython zmq kernel.""" | |
83 |
|
83 | |||
@@ -108,7 +108,7 b' class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonMixinConsoleApp):' | |||||
108 | self.swallow_args(frontend_aliases,frontend_flags,argv=argv) |
|
108 | self.swallow_args(frontend_aliases,frontend_flags,argv=argv) | |
109 |
|
109 | |||
110 | def init_shell(self): |
|
110 | def init_shell(self): | |
111 |
IPython |
|
111 | IPythonConsoleApp.initialize(self) | |
112 | # relay sigint to kernel |
|
112 | # relay sigint to kernel | |
113 | signal.signal(signal.SIGINT, self.handle_sigint) |
|
113 | signal.signal(signal.SIGINT, self.handle_sigint) | |
114 | self.shell = ZMQTerminalInteractiveShell.instance(config=self.config, |
|
114 | self.shell = ZMQTerminalInteractiveShell.instance(config=self.config, |
General Comments 0
You need to be logged in to leave comments.
Login now