diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 7a899f9..6bb9e8b 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -1495,7 +1495,12 @@ define([ base_url: this.base_url, notebook_path: this.notebook_path, notebook_name: this.notebook_name, + // For now, create all sessions with the 'python' kernel, which is the + // default. Later, the user will be able to select kernels. This is + // overridden if KernelManager.kernel_cmd is specified for the server. + kernel_name: 'python' notebook: this}); + this.session.start($.proxy(this._session_started, this)); }; diff --git a/IPython/html/static/services/kernels/js/kernel.js b/IPython/html/static/services/kernels/js/kernel.js index 8004c15..6d41ca5 100644 --- a/IPython/html/static/services/kernels/js/kernel.js +++ b/IPython/html/static/services/kernels/js/kernel.js @@ -15,13 +15,14 @@ define([ * A Kernel Class to communicate with the Python kernel * @Class Kernel */ - var Kernel = function (kernel_service_url, notebook) { + var Kernel = function (kernel_service_url, notebook, name) { this.events = notebook.events; this.kernel_id = null; this.shell_channel = null; this.iopub_channel = null; this.stdin_channel = null; this.kernel_service_url = kernel_service_url; + this.name = name; this.running = false; this.username = "username"; this.session_id = utils.uuid(); diff --git a/IPython/html/static/services/sessions/js/session.js b/IPython/html/static/services/sessions/js/session.js index 1cfb1a9..2283c85 100644 --- a/IPython/html/static/services/sessions/js/session.js +++ b/IPython/html/static/services/sessions/js/session.js @@ -15,6 +15,7 @@ define([ this.notebook = options.notebook; this.name = options.notebook_name; this.path = options.notebook_path; + this.kernel_name = options.kernel_name; this.base_url = options.base_url; }; @@ -24,6 +25,9 @@ define([ notebook : { name : this.name, path : this.path + }, + kernel : { + name : this.kernel_name } }; var settings = { @@ -87,7 +91,7 @@ define([ Session.prototype._handle_start_success = function (data, status, xhr) { this.id = data.id; var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels"); - this.kernel = new kernel.Kernel(kernel_service_url, this.notebook); + this.kernel = new kernel.Kernel(kernel_service_url, this.notebook, this.kernel_name); this.kernel._kernel_started(data.kernel); }; diff --git a/IPython/html/tests/notebook/save.js b/IPython/html/tests/notebook/save.js index 30c670d..d325b8f 100644 --- a/IPython/html/tests/notebook/save.js +++ b/IPython/html/tests/notebook/save.js @@ -80,7 +80,7 @@ casper.notebook_test(function () { }); return return_this_thing; }, {nbname:nbname}); - this.test.assertEquals(notebook_url == null, false, "Escaped URL in notebook list"); + this.test.assertNotEquals(notebook_url, null, "Escaped URL in notebook list"); // open the notebook this.open(notebook_url); });