|
|
|
|
@ -1288,25 +1288,19 @@ var IPython = (function (IPython) {
|
|
|
|
|
*
|
|
|
|
|
* @method start_session
|
|
|
|
|
*/
|
|
|
|
|
Notebook.prototype.start_session = function () {
|
|
|
|
|
this.session = new IPython.Session(this.notebook_name, this.notebook_path, this);
|
|
|
|
|
this.session.start($.proxy(this._session_started, this));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Once a session is started, link the code cells to the kernel
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
Notebook.prototype._session_started = function(){
|
|
|
|
|
this.kernel = this.session.kernel;
|
|
|
|
|
Notebook.prototype.start_kernel = function () {
|
|
|
|
|
var base_url = $('body').data('baseKernelUrl') + "kernels";
|
|
|
|
|
this.kernel = new IPython.Kernel(base_url);
|
|
|
|
|
this.kernel.start({notebook: this.notebook_id});
|
|
|
|
|
// Now that the kernel has been created, tell the CodeCells about it.
|
|
|
|
|
var ncells = this.ncells();
|
|
|
|
|
for (var i=0; i<ncells; i++) {
|
|
|
|
|
var cell = this.get_cell(i);
|
|
|
|
|
if (cell instanceof IPython.CodeCell) {
|
|
|
|
|
cell.set_kernel(this.session.kernel);
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
this.widget_manager = IPython.WidgetManager(this.kernel.comm_manager);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|