Show More
@@ -64,7 +64,7 b' var IPython = (function (IPython) {' | |||||
64 |
|
64 | |||
65 |
|
65 | |||
66 | Kernel.prototype.restart = function () { |
|
66 | Kernel.prototype.restart = function () { | |
67 |
$([IPython.events]).trigger( |
|
67 | $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this}); | |
68 | var that = this; |
|
68 | var that = this; | |
69 | if (this.running) { |
|
69 | if (this.running) { | |
70 | this.stop_channels(); |
|
70 | this.stop_channels(); | |
@@ -86,6 +86,7 b' var IPython = (function (IPython) {' | |||||
86 | this.start_channels(); |
|
86 | this.start_channels(); | |
87 | this.shell_channel.onmessage = $.proxy(this._handle_shell_reply,this); |
|
87 | this.shell_channel.onmessage = $.proxy(this._handle_shell_reply,this); | |
88 | this.iopub_channel.onmessage = $.proxy(this._handle_iopub_reply,this); |
|
88 | this.iopub_channel.onmessage = $.proxy(this._handle_iopub_reply,this); | |
|
89 | $([IPython.events]).trigger('status_started.Kernel', {kernel: this}); | |||
89 | }; |
|
90 | }; | |
90 |
|
91 | |||
91 |
|
92 | |||
@@ -245,7 +246,8 b' var IPython = (function (IPython) {' | |||||
245 | user_expressions : {}, |
|
246 | user_expressions : {}, | |
246 | allow_stdin : false |
|
247 | allow_stdin : false | |
247 | }; |
|
248 | }; | |
248 |
|
|
249 | $.extend(true, content, options) | |
|
250 | $([IPython.events]).trigger('execution_request.Kernel', {kernel: this, content:content}); | |||
249 | var msg = this._get_msg("execute_request", content); |
|
251 | var msg = this._get_msg("execute_request", content); | |
250 | this.shell_channel.send(JSON.stringify(msg)); |
|
252 | this.shell_channel.send(JSON.stringify(msg)); | |
251 | this.set_callbacks_for_msg(msg.header.msg_id, callbacks); |
|
253 | this.set_callbacks_for_msg(msg.header.msg_id, callbacks); | |
@@ -279,7 +281,7 b' var IPython = (function (IPython) {' | |||||
279 |
|
281 | |||
280 | Kernel.prototype.interrupt = function () { |
|
282 | Kernel.prototype.interrupt = function () { | |
281 | if (this.running) { |
|
283 | if (this.running) { | |
282 |
$([IPython.events]).trigger( |
|
284 | $([IPython.events]).trigger('status_interrupting.Kernel', {kernel: this}); | |
283 | $.post(this.kernel_url + "/interrupt"); |
|
285 | $.post(this.kernel_url + "/interrupt"); | |
284 | }; |
|
286 | }; | |
285 | }; |
|
287 | }; | |
@@ -312,6 +314,7 b' var IPython = (function (IPython) {' | |||||
312 |
|
314 | |||
313 | Kernel.prototype._handle_shell_reply = function (e) { |
|
315 | Kernel.prototype._handle_shell_reply = function (e) { | |
314 | reply = $.parseJSON(e.data); |
|
316 | reply = $.parseJSON(e.data); | |
|
317 | $([IPython.events]).trigger('shell_reply.Kernel', {kernel: this, reply:reply}); | |||
315 | var header = reply.header; |
|
318 | var header = reply.header; | |
316 | var content = reply.content; |
|
319 | var content = reply.content; | |
317 | var metadata = reply.metadata; |
|
320 | var metadata = reply.metadata; | |
@@ -367,12 +370,12 b' var IPython = (function (IPython) {' | |||||
367 | } |
|
370 | } | |
368 | } else if (msg_type === 'status') { |
|
371 | } else if (msg_type === 'status') { | |
369 | if (content.execution_state === 'busy') { |
|
372 | if (content.execution_state === 'busy') { | |
370 |
$([IPython.events]).trigger( |
|
373 | $([IPython.events]).trigger('status_busy.Kernel', {kernel: this}); | |
371 | } else if (content.execution_state === 'idle') { |
|
374 | } else if (content.execution_state === 'idle') { | |
372 |
$([IPython.events]).trigger( |
|
375 | $([IPython.events]).trigger('status_idle.Kernel', {kernel: this}); | |
373 | } else if (content.execution_state === 'dead') { |
|
376 | } else if (content.execution_state === 'dead') { | |
374 | this.stop_channels(); |
|
377 | this.stop_channels(); | |
375 |
$([IPython.events]).trigger( |
|
378 | $([IPython.events]).trigger('status_dead.Kernel', {kernel: this}); | |
376 | }; |
|
379 | }; | |
377 | } else if (msg_type === 'clear_output') { |
|
380 | } else if (msg_type === 'clear_output') { | |
378 | var cb = callbacks['clear_output']; |
|
381 | var cb = callbacks['clear_output']; |
General Comments 0
You need to be logged in to leave comments.
Login now