Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jupyter-js-services

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jupyter-js-services - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

51

lib/session.js

@@ -366,17 +366,4 @@ // Copyright (c) Jupyter Development Team.

}
var options = utils.copy(this._options);
options.ajaxSettings = this.ajaxSettings;
options.kernelName = name;
options.notebookPath = this.notebookPath;
return this.delete().then(function () {
return Private.startSession(options);
}).then(function (sessionId) {
return Private.createKernel(sessionId, options);
}).then(function (kernel) {
kernel.statusChanged.connect(_this.onKernelStatus, _this);
kernel.unhandledMessage.connect(_this.onUnhandledMessage, _this);
_this._kernel = kernel;
_this.kernelChanged.emit(kernel);
return kernel;
});
// Attempt to shutdown the kernel, but change the kernel either way.
return this.kernel.shutdown().then(function () { return _this._changeKernel(name); }, function () { return _this._changeKernel(name); });
};

@@ -397,15 +384,2 @@ /**

}
return this.delete().then(function () {
_this._options = null;
_this.sessionDied.emit(void 0);
});
};
/**
* Shut down the existing session.
*
* #### Notes
* Uses the [Jupyter Notebook API](http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/jupyter-js-services/master/rest_api.yaml#!/sessions), and validates the response.
*/
NotebookSession.prototype.delete = function () {
var _this = this;
var ajaxSettings = this.ajaxSettings;

@@ -421,2 +395,3 @@ ajaxSettings.method = 'DELETE';

_this._kernel = null;
_this.sessionDied.emit(void 0);
}, function (rejected) {

@@ -441,2 +416,22 @@ if (rejected.xhr.status === 410) {

};
/**
* Change the kernel.
*/
NotebookSession.prototype._changeKernel = function (name) {
var _this = this;
var options = utils.copy(this._options);
options.ajaxSettings = this.ajaxSettings;
options.kernelName = name;
options.notebookPath = this.notebookPath;
this._kernel.dispose();
return Private.startSession(options).then(function (sessionId) {
return Private.createKernel(sessionId, options);
}).then(function (kernel) {
kernel.statusChanged.connect(_this.onKernelStatus, _this);
kernel.unhandledMessage.connect(_this.onUnhandledMessage, _this);
_this._kernel = kernel;
_this.kernelChanged.emit(kernel);
return kernel;
});
};
return NotebookSession;

@@ -443,0 +438,0 @@ })();

@@ -32,3 +32,4 @@ // Copyright (c) Jupyter Development Team.

comm_msg: { comm_id: 'string', data: 'any' },
comm_close: { comm_id: 'string' }
comm_close: { comm_id: 'string' },
shutdown_reply: { restart: 'boolean' } // Emitted by the IPython kernel.
};

@@ -35,0 +36,0 @@ /**

{
"name": "jupyter-js-services",
"version": "0.6.3",
"version": "0.6.4",
"description": "Client APIs for the Jupyter services REST APIs",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc