##// END OF EJS Templates
allow kernel_name to be undefined in js...
MinRK -
Show More
@@ -12,7 +12,7 define([
12 this.selector = selector;
12 this.selector = selector;
13 this.notebook = notebook;
13 this.notebook = notebook;
14 this.events = notebook.events;
14 this.events = notebook.events;
15 this.current_selection = notebook.default_kernel_name;
15 this.current_selection = null;
16 this.kernelspecs = {};
16 this.kernelspecs = {};
17 if (this.selector !== undefined) {
17 if (this.selector !== undefined) {
18 this.element = $(selector);
18 this.element = $(selector);
@@ -70,9 +70,6 define([
70 // Create default scroll manager.
70 // Create default scroll manager.
71 this.scroll_manager = new scrollmanager.ScrollManager(this);
71 this.scroll_manager = new scrollmanager.ScrollManager(this);
72
72
73 // default_kernel_name is a temporary measure while we implement proper
74 // kernel selection and delayed start. Do not rely on it.
75 this.default_kernel_name = 'python';
76 // TODO: This code smells (and the other `= this` line a couple lines down)
73 // TODO: This code smells (and the other `= this` line a couple lines down)
77 // We need a better way to deal with circular instance references.
74 // We need a better way to deal with circular instance references.
78 this.keyboard_manager.notebook = this;
75 this.keyboard_manager.notebook = this;
@@ -1565,9 +1562,6 define([
1565 */
1562 */
1566 Notebook.prototype.start_session = function (kernel_name) {
1563 Notebook.prototype.start_session = function (kernel_name) {
1567 var that = this;
1564 var that = this;
1568 if (kernel_name === undefined) {
1569 kernel_name = this.default_kernel_name;
1570 }
1571 if (this._session_starting) {
1565 if (this._session_starting) {
1572 throw new session.SessionAlreadyStarting();
1566 throw new session.SessionAlreadyStarting();
1573 }
1567 }
@@ -2332,7 +2326,7 define([
2332 // code execution upon loading, which is a security risk.
2326 // code execution upon loading, which is a security risk.
2333 if (this.session === null) {
2327 if (this.session === null) {
2334 var kernelspec = this.metadata.kernelspec || {};
2328 var kernelspec = this.metadata.kernelspec || {};
2335 var kernel_name = kernelspec.name || this.default_kernel_name;
2329 var kernel_name = kernelspec.name;
2336
2330
2337 this.start_session(kernel_name);
2331 this.start_session(kernel_name);
2338 }
2332 }
General Comments 0
You need to be logged in to leave comments. Login now