Show More
@@ -28,22 +28,22 b' var IPython = (function (IPython) {' | |||
|
28 | 28 | return msg; |
|
29 | 29 | } |
|
30 | 30 | |
|
31 |
Kernel.prototype.start_kernel = function (callback |
|
|
31 | Kernel.prototype.start_kernel = function (callback) { | |
|
32 | 32 | var that = this; |
|
33 | 33 | $.post(this.base_url, |
|
34 | 34 | function (kernel_id) { |
|
35 |
that._handle_start_kernel(kernel_id, callback |
|
|
35 | that._handle_start_kernel(kernel_id, callback); | |
|
36 | 36 | }, |
|
37 | 37 | 'json' |
|
38 | 38 | ); |
|
39 | 39 | }; |
|
40 | 40 | |
|
41 | 41 | |
|
42 |
Kernel.prototype._handle_start_kernel = function (kernel_id, callback |
|
|
42 | Kernel.prototype._handle_start_kernel = function (kernel_id, callback) { | |
|
43 | 43 | this.kernel_id = kernel_id; |
|
44 | 44 | this.kernel_url = this.base_url + "/" + this.kernel_id; |
|
45 | 45 | this._start_channels(); |
|
46 |
callback |
|
|
46 | callback(); | |
|
47 | 47 | }; |
|
48 | 48 | |
|
49 | 49 |
@@ -367,30 +367,27 b' var IPython = (function (IPython) {' | |||
|
367 | 367 | |
|
368 | 368 | Notebook.prototype.start_kernel = function () { |
|
369 | 369 | this.kernel = new IPython.Kernel(); |
|
370 |
this.kernel.start_kernel(this. |
|
|
370 | this.kernel.start_kernel($.proxy(this.kernel_started, this)); | |
|
371 | 371 | }; |
|
372 | 372 | |
|
373 | 373 | |
|
374 |
Notebook.prototype. |
|
|
375 | console.log("Kernel started: ", this.kernel.kernel_id); | |
|
376 | var that = this; | |
|
377 | ||
|
378 | this.kernel.shell_channel.onmessage = function (e) { | |
|
374 | Notebook.prototype.handle_shell_reply = function (e) { | |
|
379 | 375 |
|
|
380 | 376 |
|
|
381 | 377 |
|
|
382 |
|
|
|
378 | var cell = this.cell_for_msg(reply.parent_header.msg_id); | |
|
383 | 379 |
|
|
384 | 380 |
|
|
385 | 381 |
|
|
386 | 382 |
|
|
387 | 383 | |
|
388 | this.kernel.iopub_channel.onmessage = function (e) { | |
|
384 | ||
|
385 | Notebook.prototype.handle_iopub_reply = function (e) { | |
|
389 | 386 |
|
|
390 | 387 |
|
|
391 | 388 |
|
|
392 | 389 |
|
|
393 |
|
|
|
390 | var cell = this.cell_for_msg(reply.parent_header.msg_id); | |
|
394 | 391 |
|
|
395 | 392 |
|
|
396 | 393 |
|
@@ -405,12 +402,18 b' var IPython = (function (IPython) {' | |||
|
405 | 402 |
|
|
406 | 403 |
|
|
407 | 404 |
|
|
408 |
|
|
|
405 | this.kernel.status_busy(); | |
|
409 | 406 |
|
|
410 |
|
|
|
407 | this.kernel.status_idle(); | |
|
411 | 408 |
|
|
412 | 409 |
|
|
413 | 410 |
|
|
411 | ||
|
412 | ||
|
413 | Notebook.prototype.kernel_started = function () { | |
|
414 | console.log("Kernel started: ", this.kernel.kernel_id); | |
|
415 | this.kernel.shell_channel.onmessage = $.proxy(this.handle_shell_reply,this); | |
|
416 | this.kernel.iopub_channel.onmessage = $.proxy(this.handle_iopub_reply,this); | |
|
414 | 417 | }; |
|
415 | 418 | |
|
416 | 419 |
General Comments 0
You need to be logged in to leave comments.
Login now