Skip to content

Commit 9107c4e

Browse files
committed
deprecate notebook_dir following deprecation pattern from notebook
1 parent a6f976b commit 9107c4e

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

docs/source/extending/handlers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ following:
115115
Called when the extension is loaded.
116116
117117
Args:
118-
nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance.
118+
nb_server_app: handle to the Notebook webserver instance.
119119
"""
120120
web_app = nb_server_app.web_app
121121
host_pattern = '.*$'

jupyter_server/serverapp.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,23 +1050,15 @@ def _update_pylab(self, change):
10501050
)
10511051
self.exit(1)
10521052

1053-
notebook_dir = Unicode(config=True,
1053+
notebook_dir = Unicode(
1054+
config=True,
10541055
help=_("DEPRECATED, use root_dir.")
10551056
)
10561057

1057-
@default('notebook_dir')
1058-
def _default_notebook_dir(self):
1059-
self.log.warning(_("\n notebook_dir is deprecated, use root_dir.\n"))
1060-
return self.root_dir
1061-
10621058
@observe('notebook_dir')
10631059
def _update_notebook_dir(self, change):
1064-
self.log.warning(_("\n notebook_dir is deprecated, use root_dir.\n"))
1065-
"""Do a bit of validation of the notebook dir."""
1066-
new = change['new']
1067-
# Check that notebook_dir and root_dir are equal
1068-
if self.root_dir != new:
1069-
self.root_dir = new
1060+
self.log.warning(_("notebook_dir is deprecated, use root_dir"))
1061+
self.root_dir = change['new']
10701062

10711063
root_dir = Unicode(config=True,
10721064
help=_("The directory to use for notebooks and kernels.")
@@ -1102,9 +1094,6 @@ def _update_root_dir(self, change):
11021094
new = change['new']
11031095
self.config.FileContentsManager.root_dir = new
11041096
self.config.MappingKernelManager.root_dir = new
1105-
# Check that notebook_dir and root_dir are equal
1106-
if self.notebook_dir != new:
1107-
self.notebook_dir = new
11081097

11091098
@observe('server_extensions')
11101099
def _update_server_extensions(self, change):

0 commit comments

Comments
 (0)