How to use jupyter-paths - 4 common examples

To help you get started, we’ve selected a few jupyter-paths examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / sidecar / app.js View on Github external
* file is referencing no longer responds to a heartbeat. Locate the sidecar window corresponding
 * to this kernel and shut it down.
 *
 * @param connPath {string} the filesystem path to the connection JSON file.
 */
function handleDeadKernel(connPath) {
  console.log("Connection " + connPath + " is no longer present.");

  if (liveSidecars.has(connPath)) {
    console.log("Closing the corresponding sidecar.");
    liveSidecars.get(connPath).close();
    liveSidecars.delete(connPath);
  }
}

var kw = new RuntimeWatch(updateKernel, jp.paths.runtime[0]);

// This method will be called when Electron has done every
// initialization and is ready for creating browser windows.
app.on('ready', function() {
		globalShortcut.register('Alt+CmdOrCtrl+I', function () {
			var win = BrowserWindow.getFocusedWindow();

			if (win) {
				win.toggleDevTools();
			}
		});

		globalShortcut.register('CmdOrCtrl+R', function () {
			var win = BrowserWindow.getFocusedWindow();

			if (win) {
github nteract / kernelspecs / lib / traverse.js View on Github external
function findAll() {
  return jp.dataDirs({ withSysPrefix: true }).then(dirs => {
    return Promise.all(dirs
      // get kernel infos for each directory and ignore errors
      .map(dir => getKernelInfos(path.join(dir, 'kernels')).catch(() => {}))
    ).then(extractKernelResources)
  });
}
github nteract / nteract / applications / desktop / src / main / index.ts View on Github external
mergeMap(() =>
    // Create all the directories we need in parallel
    forkJoin(
      // Ensure the runtime Dir is setup for kernels
      mkdirpObservable(jupyterPaths.runtimeDir()),
      // Ensure the config directory is all set up
      mkdirpObservable(jupyterConfigDir)
    )
  ),
github nteract / kernelspecs / lib / traverse.js View on Github external
function find(kernelName) {
  return jp.dataDirs({ withSysPrefix: true }).then(dirs => {

    const kernelInfos = dirs.map(dir => ({
      name: kernelName,
      resourceDir: path.join(dir, 'kernels', kernelName),
    }))

    return extractKernelResources(kernelInfos);
  }).then(kernelResource => kernelResource[kernelName])
}

jupyter-paths

Node wrapping of jupyter/jupyter_core to resolve paths across Jupyter installations.

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

49 / 100
Full package analysis