okdistribute / jupyter-kernel-watch

Watches a jupyter kernel for you. Emits events when things are changed!
2 stars 0 forks source link

Typical kernelspec use case #1

Open rgbkrk opened 9 years ago

rgbkrk commented 9 years ago

Typically, the way you'd look for kernelspecs is across a series of directories which can differ from OS to installation, etc. For the purpose of jupyter-kernel-watch, this means receiving a list of directories like so:

[ '/Users/rgbkrk/Library/Jupyter/kernels',
  '/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/share/jupyter/kernels',
  '/usr/local/share/jupyter/kernels',
  '/usr/share/jupyter/kernels',
  '/Users/rgbkrk/.ipython/kernels' ]

Within each of those, is several kernel spec bundles:

~/Library/Jupyter/kernels$ ls
hy      ir      python2 test
~/Library/Jupyter/kernels$ ls *
hy:
kernel.js      kernel.json    logo-32x32.png logo-64x64.png

ir:
kernel.json    logo-64x64.png

python2:
kernel.json    logo-32x32.png logo-64x64.png

test:
kernel.json
~/Library/Jupyter/kernels$ cd ~/.ipython/kernels
~/.ipython/kernels$  ls
javascript scala-2.11
~/.ipython/kernels$ ls *
javascript:
kernel.json

scala-2.11:
kernel.json

What a given user wants at the start is every kernelspec available and then they'd like updates to know when there are more kernels. Same thing happens with the notebook server when the page is refreshed (though it's a call to a REST API rather than evented IO based on filesystem changes).

rgbkrk commented 9 years ago

Looks like it's noticing changes right now but no new kernels (or providing the list of initial kernels).