From 13095eee664f7f05f2876c5831ea91ecefdca87b 2015-02-02 22:23:00 From: Min RK Date: 2015-02-02 22:23:00 Subject: [PATCH] don't trigger kernel_starting after kernel_connected trigger instead at the beginning of Kernel.start if a websocket is fully connected, the kernel has finished starting --- diff --git a/IPython/html/static/services/kernels/kernel.js b/IPython/html/static/services/kernels/kernel.js index bb566ac..f414507 100644 --- a/IPython/html/static/services/kernels/kernel.js +++ b/IPython/html/static/services/kernels/kernel.js @@ -180,6 +180,7 @@ define([ url = url + "?" + qs; } + this.events.trigger('kernel_starting.Kernel', {kernel: this}); var that = this; var on_success = function (data, status, xhr) { that.events.trigger('kernel_created.Kernel', {kernel: that}); @@ -402,7 +403,6 @@ define([ * @function _kernel_connected */ this.events.trigger('kernel_connected.Kernel', {kernel: this}); - this.events.trigger('kernel_starting.Kernel', {kernel: this}); // get kernel info so we know what state the kernel is in var that = this; this.kernel_info(function (reply) { diff --git a/IPython/html/tests/services/kernel.js b/IPython/html/tests/services/kernel.js index a944bd4..3ce1abf 100644 --- a/IPython/html/tests/services/kernel.js +++ b/IPython/html/tests/services/kernel.js @@ -163,9 +163,9 @@ casper.notebook_test(function () { 'kill/start', [ 'kernel_killed.Kernel', + 'kernel_starting.Kernel', 'kernel_created.Kernel', 'kernel_connected.Kernel', - 'kernel_starting.Kernel', 'kernel_ready.Kernel' ], function () { @@ -205,7 +205,6 @@ casper.notebook_test(function () { 'kernel_restarting.Kernel', 'kernel_created.Kernel', 'kernel_connected.Kernel', - 'kernel_starting.Kernel', 'kernel_ready.Kernel' ], function () { diff --git a/IPython/html/tests/services/session.js b/IPython/html/tests/services/session.js index ed7c90b..375c3bc 100644 --- a/IPython/html/tests/services/session.js +++ b/IPython/html/tests/services/session.js @@ -100,7 +100,6 @@ casper.notebook_test(function () { [ 'kernel_created.Session', 'kernel_connected.Kernel', - 'kernel_starting.Kernel', 'kernel_ready.Kernel' ], function () { @@ -129,7 +128,6 @@ casper.notebook_test(function () { 'kernel_killed.Session', 'kernel_created.Session', 'kernel_connected.Kernel', - 'kernel_starting.Kernel', 'kernel_ready.Kernel' ], function () {