Show More
@@ -59,6 +59,7 define([ | |||||
59 | this.keyboard_manager = options.keyboard_manager; |
|
59 | this.keyboard_manager = options.keyboard_manager; | |
60 | this.save_widget = options.save_widget; |
|
60 | this.save_widget = options.save_widget; | |
61 | this.tooltip = new tooltip.Tooltip(this.events); |
|
61 | this.tooltip = new tooltip.Tooltip(this.events); | |
|
62 | this.ws_url = options.ws_url; | |||
62 | // default_kernel_name is a temporary measure while we implement proper |
|
63 | // default_kernel_name is a temporary measure while we implement proper | |
63 | // kernel selection and delayed start. Do not rely on it. |
|
64 | // kernel selection and delayed start. Do not rely on it. | |
64 | this.default_kernel_name = 'python'; |
|
65 | this.default_kernel_name = 'python'; | |
@@ -1496,6 +1497,7 define([ | |||||
1496 | Notebook.prototype.start_session = function () { |
|
1497 | Notebook.prototype.start_session = function () { | |
1497 | this.session = new session.Session({ |
|
1498 | this.session = new session.Session({ | |
1498 | base_url: this.base_url, |
|
1499 | base_url: this.base_url, | |
|
1500 | ws_url: this.ws_url, | |||
1499 | notebook_path: this.notebook_path, |
|
1501 | notebook_path: this.notebook_path, | |
1500 | notebook_name: this.notebook_name, |
|
1502 | notebook_name: this.notebook_name, | |
1501 | // For now, create all sessions with the 'python' kernel, which is the |
|
1503 | // For now, create all sessions with the 'python' kernel, which is the |
@@ -15,7 +15,7 define([ | |||||
15 | * A Kernel Class to communicate with the Python kernel |
|
15 | * A Kernel Class to communicate with the Python kernel | |
16 | * @Class Kernel |
|
16 | * @Class Kernel | |
17 | */ |
|
17 | */ | |
18 | var Kernel = function (kernel_service_url, notebook, name) { |
|
18 | var Kernel = function (kernel_service_url, ws_url, notebook, name) { | |
19 | this.events = notebook.events; |
|
19 | this.events = notebook.events; | |
20 | this.kernel_id = null; |
|
20 | this.kernel_id = null; | |
21 | this.shell_channel = null; |
|
21 | this.shell_channel = null; | |
@@ -23,7 +23,7 define([ | |||||
23 | this.stdin_channel = null; |
|
23 | this.stdin_channel = null; | |
24 | this.kernel_service_url = kernel_service_url; |
|
24 | this.kernel_service_url = kernel_service_url; | |
25 | this.name = name; |
|
25 | this.name = name; | |
26 | this.ws_url = IPython.utils.get_body_data("wsUrl"); |
|
26 | this.ws_url = ws_url || IPython.utils.get_body_data("wsUrl"); | |
27 | if (!this.ws_url) { |
|
27 | if (!this.ws_url) { | |
28 | // trailing 's' in https will become wss for secure web sockets |
|
28 | // trailing 's' in https will become wss for secure web sockets | |
29 | this.ws_url = location.protocol.replace('http', 'ws') + "//" + location.host; |
|
29 | this.ws_url = location.protocol.replace('http', 'ws') + "//" + location.host; |
@@ -17,6 +17,7 define([ | |||||
17 | this.path = options.notebook_path; |
|
17 | this.path = options.notebook_path; | |
18 | this.kernel_name = options.kernel_name; |
|
18 | this.kernel_name = options.kernel_name; | |
19 | this.base_url = options.base_url; |
|
19 | this.base_url = options.base_url; | |
|
20 | this.ws_url = options.ws_url; | |||
20 | }; |
|
21 | }; | |
21 |
|
22 | |||
22 | Session.prototype.start = function(callback) { |
|
23 | Session.prototype.start = function(callback) { | |
@@ -91,7 +92,7 define([ | |||||
91 | Session.prototype._handle_start_success = function (data, status, xhr) { |
|
92 | Session.prototype._handle_start_success = function (data, status, xhr) { | |
92 | this.id = data.id; |
|
93 | this.id = data.id; | |
93 | var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels"); |
|
94 | var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels"); | |
94 | this.kernel = new kernel.Kernel(kernel_service_url, this.notebook, this.kernel_name); |
|
95 | this.kernel = new kernel.Kernel(kernel_service_url, this.ws_url, this.notebook, this.kernel_name); | |
95 | this.kernel._kernel_started(data.kernel); |
|
96 | this.kernel._kernel_started(data.kernel); | |
96 | }; |
|
97 | }; | |
97 |
|
98 |
General Comments 0
You need to be logged in to leave comments.
Login now