##// END OF EJS Templates
Update JS for kernels and sessions APIs
Thomas Kluyver -
Show More
@@ -1495,7 +1495,12 b' define(['
1495 1495 base_url: this.base_url,
1496 1496 notebook_path: this.notebook_path,
1497 1497 notebook_name: this.notebook_name,
1498 // For now, create all sessions with the 'python' kernel, which is the
1499 // default. Later, the user will be able to select kernels. This is
1500 // overridden if KernelManager.kernel_cmd is specified for the server.
1501 kernel_name: 'python'
1498 1502 notebook: this});
1503
1499 1504 this.session.start($.proxy(this._session_started, this));
1500 1505 };
1501 1506
@@ -15,13 +15,14 b' define(['
15 15 * A Kernel Class to communicate with the Python kernel
16 16 * @Class Kernel
17 17 */
18 var Kernel = function (kernel_service_url, notebook) {
18 var Kernel = function (kernel_service_url, notebook, name) {
19 19 this.events = notebook.events;
20 20 this.kernel_id = null;
21 21 this.shell_channel = null;
22 22 this.iopub_channel = null;
23 23 this.stdin_channel = null;
24 24 this.kernel_service_url = kernel_service_url;
25 this.name = name;
25 26 this.running = false;
26 27 this.username = "username";
27 28 this.session_id = utils.uuid();
@@ -15,6 +15,7 b' define(['
15 15 this.notebook = options.notebook;
16 16 this.name = options.notebook_name;
17 17 this.path = options.notebook_path;
18 this.kernel_name = options.kernel_name;
18 19 this.base_url = options.base_url;
19 20 };
20 21
@@ -24,6 +25,9 b' define(['
24 25 notebook : {
25 26 name : this.name,
26 27 path : this.path
28 },
29 kernel : {
30 name : this.kernel_name
27 31 }
28 32 };
29 33 var settings = {
@@ -87,7 +91,7 b' define(['
87 91 Session.prototype._handle_start_success = function (data, status, xhr) {
88 92 this.id = data.id;
89 93 var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels");
90 this.kernel = new kernel.Kernel(kernel_service_url, this.notebook);
94 this.kernel = new kernel.Kernel(kernel_service_url, this.notebook, this.kernel_name);
91 95 this.kernel._kernel_started(data.kernel);
92 96 };
93 97
@@ -80,7 +80,7 b' casper.notebook_test(function () {'
80 80 });
81 81 return return_this_thing;
82 82 }, {nbname:nbname});
83 this.test.assertEquals(notebook_url == null, false, "Escaped URL in notebook list");
83 this.test.assertNotEquals(notebook_url, null, "Escaped URL in notebook list");
84 84 // open the notebook
85 85 this.open(notebook_url);
86 86 });
General Comments 0
You need to be logged in to leave comments. Login now