From d689ac1a3818ba1f2b6e98a46e74e5ac9c38432b Mon Sep 17 00:00:00 2001 From: Daniel Krenn Date: Mon, 23 Jan 2017 07:35:41 +0100 Subject: [PATCH 1/3] trigger an event finished_iopub.Kernel --- notebook/static/services/kernels/kernel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/notebook/static/services/kernels/kernel.js b/notebook/static/services/kernels/kernel.js index 4e1cbd1c0..24f40068b 100644 --- a/notebook/static/services/kernels/kernel.js +++ b/notebook/static/services/kernels/kernel.js @@ -940,6 +940,7 @@ define([ this.clear_callbacks_for_msg(msg_id); } } + this.events.trigger('finished_iopub.Kernel', {kernel: this, msg_id: msg_id}); }; /** From 540b51e7d0ecf318313c0b045108ed74cbb947fa Mon Sep 17 00:00:00 2001 From: Daniel Krenn Date: Mon, 23 Jan 2017 07:36:02 +0100 Subject: [PATCH 2/3] trigger an event finished_execute.CodeCell --- notebook/static/notebook/js/codecell.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 86526838d..40bd74408 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -334,6 +334,12 @@ define([ CodeCell.msg_cells[this.last_msg_id] = this; this.render(); this.events.trigger('execute.CodeCell', {cell: this}); + this.events.on('finished_iopub.Kernel', function (evt, data) { + if (that.kernel.id === data.kernel.id && that.last_msg_id === data.msg_id) { + console.log('finished_execute.CodeCell', {cell: that}); + this.events.trigger('finished_execute.CodeCell', {cell: that}); + } + }); }; /** From e3bdb1586c41772522c6b6379ae3451b4f8d205b Mon Sep 17 00:00:00 2001 From: Daniel Krenn Date: Tue, 24 Jan 2017 13:16:20 +0100 Subject: [PATCH 3/3] cleanup --- notebook/static/notebook/js/codecell.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 40bd74408..54781cf6f 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -334,10 +334,10 @@ define([ CodeCell.msg_cells[this.last_msg_id] = this; this.render(); this.events.trigger('execute.CodeCell', {cell: this}); + var that = this; this.events.on('finished_iopub.Kernel', function (evt, data) { if (that.kernel.id === data.kernel.id && that.last_msg_id === data.msg_id) { - console.log('finished_execute.CodeCell', {cell: that}); - this.events.trigger('finished_execute.CodeCell', {cell: that}); + that.events.trigger('finished_execute.CodeCell', {cell: that}); } }); };