Show More
@@ -421,11 +421,11 class InteractiveShell(SingletonConfigurable): | |||
|
421 | 421 | |
|
422 | 422 | def __init__(self, config=None, ipython_dir=None, profile_dir=None, |
|
423 | 423 | user_module=None, user_ns=None, |
|
424 | custom_exceptions=((), None)): | |
|
424 | custom_exceptions=((), None), **kwargs): | |
|
425 | 425 | |
|
426 | 426 | # This is where traits with a config_key argument are updated |
|
427 | 427 | # from the values on config. |
|
428 | super(InteractiveShell, self).__init__(config=config) | |
|
428 | super(InteractiveShell, self).__init__(config=config, **kwargs) | |
|
429 | 429 | self.configurables = [self] |
|
430 | 430 | |
|
431 | 431 | # These are relatively independent and stateless |
@@ -115,8 +115,8 class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonConsoleApp): | |||
|
115 | 115 | self.shell = ZMQTerminalInteractiveShell.instance(config=self.config, |
|
116 | 116 | display_banner=False, profile_dir=self.profile_dir, |
|
117 | 117 | ipython_dir=self.ipython_dir, |
|
118 |
|
|
|
119 |
|
|
|
118 | manager=self.kernel_manager, | |
|
119 | client=self.kernel_client, | |
|
120 | 120 | ) |
|
121 | 121 | |
|
122 | 122 | def init_gui_pylab(self): |
@@ -125,7 +125,7 class ZMQTerminalIPythonApp(TerminalIPythonApp, IPythonConsoleApp): | |||
|
125 | 125 | |
|
126 | 126 | def handle_sigint(self, *args): |
|
127 | 127 | if self.shell._executing: |
|
128 |
if self.kernel_manager |
|
|
128 | if self.kernel_manager: | |
|
129 | 129 | # interrupt already gets passed to subprocess by signal handler. |
|
130 | 130 | # Only if we prevent that should we need to explicitly call |
|
131 | 131 | # interrupt_kernel, until which time, this would result in a |
@@ -1,12 +1,9 | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | """Frontend of ipython working with python-zmq | |
|
2 | """terminal client to the IPython kernel | |
|
3 | 3 | |
|
4 | Ipython's frontend, is a ipython interface that send request to kernel and proccess the kernel's outputs. | |
|
5 | ||
|
6 | For more details, see the ipython-zmq design | |
|
7 | 4 | """ |
|
8 | 5 | #----------------------------------------------------------------------------- |
|
9 |
# Copyright (C) 201 |
|
|
6 | # Copyright (C) 2013 The IPython Development Team | |
|
10 | 7 | # |
|
11 | 8 | # Distributed under the terms of the BSD License. The full license is in |
|
12 | 9 | # the file COPYING, distributed as part of this software. |
@@ -37,7 +34,7 from IPython.core.alias import AliasManager, AliasError | |||
|
37 | 34 | from IPython.core import page |
|
38 | 35 | from IPython.utils.warn import warn, error, fatal |
|
39 | 36 | from IPython.utils import io |
|
40 | from IPython.utils.traitlets import List, Enum, Any | |
|
37 | from IPython.utils.traitlets import List, Enum, Any, Instance, Unicode | |
|
41 | 38 | from IPython.utils.tempdir import NamedFileInTemporaryDirectory |
|
42 | 39 | |
|
43 | 40 | from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell |
@@ -105,12 +102,12 class ZMQTerminalInteractiveShell(TerminalInteractiveShell): | |||
|
105 | 102 | """ |
|
106 | 103 | ) |
|
107 | 104 | |
|
108 | def __init__(self, *args, **kwargs): | |
|
109 | self.manager = kwargs.pop('kernel_manager', None) | |
|
110 | self.client = kwargs.pop('kernel_client') | |
|
111 |
self.session_id = |
|
|
112 | super(ZMQTerminalInteractiveShell, self).__init__(*args, **kwargs) | |
|
113 | ||
|
105 | manager = Instance('IPython.kernel.KernelManager') | |
|
106 | client = Instance('IPython.kernel.KernelClient') | |
|
107 | def _client_changed(self, name, old, new): | |
|
108 | self.session_id = new.session.session | |
|
109 | session_id = Unicode() | |
|
110 | ||
|
114 | 111 | def init_completer(self): |
|
115 | 112 | """Initialize the completion machinery. |
|
116 | 113 |
@@ -368,11 +368,13 class TerminalInteractiveShell(InteractiveShell): | |||
|
368 | 368 | |
|
369 | 369 | def __init__(self, config=None, ipython_dir=None, profile_dir=None, |
|
370 | 370 | user_ns=None, user_module=None, custom_exceptions=((),None), |
|
371 |
usage=None, banner1=None, banner2=None, display_banner=None |
|
|
371 | usage=None, banner1=None, banner2=None, display_banner=None, | |
|
372 | **kwargs): | |
|
372 | 373 | |
|
373 | 374 | super(TerminalInteractiveShell, self).__init__( |
|
374 | 375 | config=config, ipython_dir=ipython_dir, profile_dir=profile_dir, user_ns=user_ns, |
|
375 | user_module=user_module, custom_exceptions=custom_exceptions | |
|
376 | user_module=user_module, custom_exceptions=custom_exceptions, | |
|
377 | **kwargs | |
|
376 | 378 | ) |
|
377 | 379 | # use os.system instead of utils.process.system by default, |
|
378 | 380 | # because piped system doesn't make sense in the Terminal: |
General Comments 0
You need to be logged in to leave comments.
Login now