Skip to content

Commit

Permalink
check that notebook_dir and root_dir are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Nov 30, 2018
1 parent e4abc6a commit 02eb6f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,14 @@ def _default_notebook_dir(self):
self.log.warning(_("\n notebook_dir is deprecated, use root_dir.\n"))
return self.root_dir

@validate('notebook_dir')
@observe('notebook_dir')
def _update_notebook_dir(self, change):
self.log.warning(_("\n notebook_dir is deprecated, use root_dir.\n"))
self.root_dir = change['value']
"""Do a bit of validation of the notebook dir."""
new = change['new']
# Check that notebook_dir and root_dir are equal
if new != self.root_dir:
self.root_dir = new

root_dir = Unicode(config=True,
help=_("The directory to use for notebooks and kernels.")
Expand Down Expand Up @@ -1098,6 +1102,9 @@ def _update_root_dir(self, change):
new = change['new']
self.config.FileContentsManager.root_dir = new
self.config.MappingKernelManager.root_dir = new
# Check that notebook_dir and root_dir are equal
if self.notebook_dir != new:
self.notebook_dir = new

@observe('server_extensions')
def _update_server_extensions(self, change):
Expand Down

0 comments on commit 02eb6f6

Please sign in to comment.