takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
304 stars 58 forks source link

Use notebook_dir or file_to_run automatically #17

Open remram44 opened 9 years ago

remram44 commented 9 years ago

Doesn't fix #15, but at least opens the right notebook if you pass a directory to nbopen.

takluyver commented 9 years ago

I'm ambivalent about specifying directories for nbopen - I mainly see the Python code as infrastructure for integrating IPython with a desktop environment so you can double click on notebooks.

It should still specify notebook_dir when you run it with a notebook file, though, which I think this currently breaks.

remram44 commented 9 years ago

It should still specify notebook_dir when you run it with a notebook file, though, which I think this currently breaks.

I don't get what you mean, sorry. This seems very close to what notebookapp does (or did, don't know much about 3.x)

takluyver commented 9 years ago

At present, when I run it with a notebook file, it will call launch_new_instance() specifying both file_to_run and notebook_dir. With this branch, it will only specify file_to_run.

remram44 commented 9 years ago

I had totally missed that notebook_dir was in there at all. Shouldn't it be the dirname() of the notebook? Using the homedir is unnecessarily unsafe...

Another approach would be to add a --notebook_dir option (although what I use nbopen for is just open a directory, not a specific notebook).