From af999fb1e9ae1498cbf4d5985c1cbd88d33bfab5 2012-10-26 20:03:57 From: Matthias BUSSONNIER Date: 2012-10-26 20:03:57 Subject: [PATCH] Add event to kernel execution/shell reply. This should allow to hook more easily phantomjs for testing. --- diff --git a/IPython/frontend/html/notebook/static/js/kernel.js b/IPython/frontend/html/notebook/static/js/kernel.js index dea7711..1334884 100644 --- a/IPython/frontend/html/notebook/static/js/kernel.js +++ b/IPython/frontend/html/notebook/static/js/kernel.js @@ -245,7 +245,8 @@ var IPython = (function (IPython) { user_expressions : {}, allow_stdin : false }; - $.extend(true, content, options) + $.extend(true, content, options) + $([IPython.events]).trigger({type: 'Kernel.execution_request', kernel: this, content:content}); var msg = this._get_msg("execute_request", content); this.shell_channel.send(JSON.stringify(msg)); this.set_callbacks_for_msg(msg.header.msg_id, callbacks); @@ -312,6 +313,7 @@ var IPython = (function (IPython) { Kernel.prototype._handle_shell_reply = function (e) { reply = $.parseJSON(e.data); + $([IPython.events]).trigger({type: 'Kernel.shell_reply', kernel: this, reply:reply}); var header = reply.header; var content = reply.content; var metadata = reply.metadata;