##// END OF EJS Templates
Don't actually change kernel constructor signature
Jessica B. Hamrick -
Show More
@@ -20,13 +20,12 b' define(['
20 20 * @param {string} kernel_service_url - the URL to access the kernel REST api
21 21 * @param {string} ws_url - the websockets URL
22 22 * @param {Notebook} notebook - notebook object
23 * @param {string} id - the kernel id
24 23 * @param {string} name - the kernel type (e.g. python3)
25 24 */
26 var Kernel = function (kernel_service_url, ws_url, notebook, id, name) {
25 var Kernel = function (kernel_service_url, ws_url, notebook, name) {
27 26 this.events = notebook.events;
28 27
29 this.id = id;
28 this.id = null;
30 29 this.name = name;
31 30
32 31 this.channels = {
@@ -36,7 +35,7 b' define(['
36 35 };
37 36
38 37 this.kernel_service_url = kernel_service_url;
39 this.kernel_url = utils.url_join_encode(this.kernel_service_url, this.id);
38 this.kernel_url = null;
40 39 this.ws_url = ws_url || IPython.utils.get_body_data("wsUrl");
41 40 if (!this.ws_url) {
42 41 // trailing 's' in https will become wss for secure web sockets
@@ -153,9 +152,7 b' define(['
153 152
154 153 var that = this;
155 154 var on_success = function (data, status, xhr) {
156 that.id = data.id;
157 that.kernel_url = utils.url_join_encode(that.kernel_service_url, that.id);
158 that._kernel_started();
155 that._kernel_started(data);
159 156 if (success) {
160 157 success(data, status, xhr);
161 158 }
@@ -256,7 +253,7 b' define(['
256 253
257 254 var that = this;
258 255 var on_success = function (data, status, xhr) {
259 that._kernel_started();
256 that._kernel_started(data);
260 257 if (success) {
261 258 success(data, status, xhr);
262 259 }
@@ -332,8 +329,12 b' define(['
332 329 * then actually connecting to the kernel.
333 330 *
334 331 * @function _kernel_started
332 * @param {Object} data - information about the kernel including id
335 333 */
336 Kernel.prototype._kernel_started = function () {
334 Kernel.prototype._kernel_started = function (data) {
335 this.id = data.id;
336 this.kernel_url = utils.url_join_encode(this.kernel_service_url, this.id);
337
337 338 console.log("Kernel started: ", this.id);
338 339 this.events.trigger('status_started.Kernel', {kernel: this});
339 340 this.start_channels();
@@ -85,10 +85,8 b' define(['
85 85 var that = this;
86 86 var on_success = function (data, status, xhr) {
87 87 var kernel_service_url = utils.url_path_join(that.base_url, "api/kernels");
88 that.kernel = new kernel.Kernel(
89 kernel_service_url, that.ws_url, that.notebook,
90 that.kernel_model.id, that.kernel_model.name);
91 that.kernel._kernel_started();
88 that.kernel = new kernel.Kernel(kernel_service_url, that.ws_url, that.notebook, that.kernel_model.name);
89 that.kernel._kernel_started(data.kernel);
92 90 if (success) {
93 91 success(data, status, xhr);
94 92 }
General Comments 0
You need to be logged in to leave comments. Login now