Show More
@@ -20,11 +20,9 b' Authors:' | |||||
20 | #----------------------------------------------------------------------------- |
|
20 | #----------------------------------------------------------------------------- | |
21 |
|
21 | |||
22 | # stdlib imports |
|
22 | # stdlib imports | |
23 | import json |
|
|||
24 | import os |
|
23 | import os | |
25 | import signal |
|
24 | import signal | |
26 | import sys |
|
25 | import sys | |
27 | import uuid |
|
|||
28 |
|
26 | |||
29 | # If run on Windows, install an exception hook which pops up a |
|
27 | # If run on Windows, install an exception hook which pops up a | |
30 | # message box. Pythonw.exe hides the console, so without this |
|
28 | # message box. Pythonw.exe hides the console, so without this | |
@@ -59,21 +57,16 b' from IPython.external.qt import QtCore, QtGui' | |||||
59 | from IPython.config.application import boolean_flag, catch_config_error |
|
57 | from IPython.config.application import boolean_flag, catch_config_error | |
60 | from IPython.core.application import BaseIPythonApplication |
|
58 | from IPython.core.application import BaseIPythonApplication | |
61 | from IPython.core.profiledir import ProfileDir |
|
59 | from IPython.core.profiledir import ProfileDir | |
62 | from IPython.frontend.qt.console.frontend_widget import FrontendWidget |
|
|||
63 | from IPython.frontend.qt.console.ipython_widget import IPythonWidget |
|
60 | from IPython.frontend.qt.console.ipython_widget import IPythonWidget | |
64 | from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget |
|
61 | from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget | |
65 | from IPython.frontend.qt.console import styles |
|
62 | from IPython.frontend.qt.console import styles | |
66 | from IPython.frontend.qt.console.mainwindow import MainWindow |
|
63 | from IPython.frontend.qt.console.mainwindow import MainWindow | |
67 | from IPython.frontend.qt.client import QtKernelClient |
|
64 | from IPython.frontend.qt.client import QtKernelClient | |
68 | from IPython.kernel import tunnel_to_kernel, find_connection_file |
|
65 | from IPython.kernel import tunnel_to_kernel, find_connection_file | |
69 | from IPython.utils.path import filefind |
|
|||
70 | from IPython.utils.py3compat import str_to_bytes |
|
|||
71 | from IPython.utils.traitlets import ( |
|
66 | from IPython.utils.traitlets import ( | |
72 |
Dict, List, Unicode, |
|
67 | Dict, List, Unicode, CBool, Any | |
73 | ) |
|
68 | ) | |
74 |
from IPython.kernel.zmq. |
|
69 | from IPython.kernel.zmq.session import default_secure | |
75 | from IPython.kernel.zmq.session import Session, default_secure |
|
|||
76 | from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell |
|
|||
77 |
|
70 | |||
78 | from IPython.frontend.consoleapp import ( |
|
71 | from IPython.frontend.consoleapp import ( | |
79 | IPythonConsoleApp, app_aliases, app_flags, flags, aliases |
|
72 | IPythonConsoleApp, app_aliases, app_flags, flags, aliases | |
@@ -201,11 +194,19 b' class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):' | |||||
201 | kwargs = dict() |
|
194 | kwargs = dict() | |
202 | kwargs['extra_arguments'] = self.kernel_argv |
|
195 | kwargs['extra_arguments'] = self.kernel_argv | |
203 | kernel_manager.start_kernel(**kwargs) |
|
196 | kernel_manager.start_kernel(**kwargs) | |
|
197 | ||||
|
198 | # connect to the kernel | |||
|
199 | kernel_client = self.kernel_client_class( | |||
|
200 | connection_file=kernel_manager.connection_file, | |||
|
201 | config=self.config, | |||
|
202 | ) | |||
|
203 | kernel_client.load_connection_file() | |||
204 | kernel_client.start_channels() |
|
204 | kernel_client.start_channels() | |
205 | widget = self.widget_factory(config=self.config, |
|
205 | widget = self.widget_factory(config=self.config, | |
206 | local_kernel=True) |
|
206 | local_kernel=True) | |
207 | self.init_colors(widget) |
|
207 | self.init_colors(widget) | |
208 | widget.kernel_manager = kernel_manager |
|
208 | widget.kernel_manager = kernel_manager | |
|
209 | widget.kernel_client = kernel_client | |||
209 | widget._existing = False |
|
210 | widget._existing = False | |
210 | widget._may_close = True |
|
211 | widget._may_close = True | |
211 | widget._confirm_exit = self.confirm_exit |
|
212 | widget._confirm_exit = self.confirm_exit | |
@@ -219,6 +220,7 b' class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):' | |||||
219 | current_widget : IPythonWidget |
|
220 | current_widget : IPythonWidget | |
220 | The IPythonWidget whose kernel this frontend is to share |
|
221 | The IPythonWidget whose kernel this frontend is to share | |
221 | """ |
|
222 | """ | |
|
223 | ||||
222 | kernel_client = self.kernel_client_class( |
|
224 | kernel_client = self.kernel_client_class( | |
223 | connection_file=current_widget.kernel_client.connection_file, |
|
225 | connection_file=current_widget.kernel_client.connection_file, | |
224 | config = self.config, |
|
226 | config = self.config, |
General Comments 0
You need to be logged in to leave comments.
Login now