Include the kernel object in the event object passed to kernel events

This commit is contained in:
Jason Grout 2012-07-21 07:08:49 -05:00
parent 8b34dfc405
commit e9324378e8

View File

@ -64,7 +64,7 @@ var IPython = (function (IPython) {
Kernel.prototype.restart = function () {
$([IPython.events]).trigger('status_restarting.Kernel');
$([IPython.events]).trigger({type: 'status_restarting.Kernel', kernel: this});
var that = this;
if (this.running) {
this.stop_channels();
@ -279,7 +279,7 @@ var IPython = (function (IPython) {
Kernel.prototype.interrupt = function () {
if (this.running) {
$([IPython.events]).trigger('status_interrupting.Kernel');
$([IPython.events]).trigger({type: 'status_interrupting.Kernel', kernel: this});
$.post(this.kernel_url + "/interrupt");
};
};
@ -367,12 +367,12 @@ var IPython = (function (IPython) {
}
} else if (msg_type === 'status') {
if (content.execution_state === 'busy') {
$([IPython.events]).trigger('status_busy.Kernel');
$([IPython.events]).trigger({type: 'status_busy.Kernel', kernel: this});
} else if (content.execution_state === 'idle') {
$([IPython.events]).trigger('status_idle.Kernel');
$([IPython.events]).trigger({type: 'status_idle.Kernel', kernel: this});
} else if (content.execution_state === 'dead') {
this.stop_channels();
$([IPython.events]).trigger('status_dead.Kernel');
$([IPython.events]).trigger({type: 'status_dead.Kernel', kernel: this});
};
} else if (msg_type === 'clear_output') {
var cb = callbacks['clear_output'];