Skip to content

Commit 6ee335f

Browse files
committed
comment out old traitlets
1 parent 86ee6e7 commit 6ee335f

File tree

4 files changed

+36
-372
lines changed

4 files changed

+36
-372
lines changed

notebook/notebookapp.py

+34-34
Original file line numberDiff line numberDiff line change
@@ -306,40 +306,40 @@ def _default_browser_open_file(self):
306306
basename = "nbserver-%s-open.html" % os.getpid()
307307
return os.path.join(self.runtime_dir, basename)
308308

309-
notebook_dir = Unicode(config=True,
310-
help=_("The directory to use for notebooks and kernels.")
311-
)
312-
313-
@default('notebook_dir')
314-
def _default_notebook_dir(self):
315-
if self.file_to_run:
316-
return os.path.dirname(os.path.abspath(self.file_to_run))
317-
else:
318-
return py3compat.getcwd()
319-
320-
@validate('notebook_dir')
321-
def _notebook_dir_validate(self, proposal):
322-
value = proposal['value']
323-
# Strip any trailing slashes
324-
# *except* if it's root
325-
_, path = os.path.splitdrive(value)
326-
if path == os.sep:
327-
return value
328-
value = value.rstrip(os.sep)
329-
if not os.path.isabs(value):
330-
# If we receive a non-absolute path, make it absolute.
331-
value = os.path.abspath(value)
332-
if not os.path.isdir(value):
333-
raise TraitError(trans.gettext("No such notebook dir: '%r'") % value)
334-
return value
335-
336-
@observe('notebook_dir')
337-
def _update_notebook_dir(self, change):
338-
"""Do a bit of validation of the notebook dir."""
339-
# setting App.notebook_dir implies setting notebook and kernel dirs as well
340-
new = change['new']
341-
self.config.FileContentsManager.root_dir = new
342-
self.config.MappingKernelManager.root_dir = new
309+
# notebook_dir = Unicode(config=True,
310+
# help=_("The directory to use for notebooks and kernels.")
311+
# )
312+
313+
# @default('notebook_dir')
314+
# def _default_notebook_dir(self):
315+
# if self.file_to_run:
316+
# return os.path.dirname(os.path.abspath(self.file_to_run))
317+
# else:
318+
# return py3compat.getcwd()
319+
320+
# @validate('notebook_dir')
321+
# def _notebook_dir_validate(self, proposal):
322+
# value = proposal['value']
323+
# # Strip any trailing slashes
324+
# # *except* if it's root
325+
# _, path = os.path.splitdrive(value)
326+
# if path == os.sep:
327+
# return value
328+
# value = value.rstrip(os.sep)
329+
# if not os.path.isabs(value):
330+
# # If we receive a non-absolute path, make it absolute.
331+
# value = os.path.abspath(value)
332+
# if not os.path.isdir(value):
333+
# raise TraitError(trans.gettext("No such notebook dir: '%r'") % value)
334+
# return value
335+
336+
# @observe('notebook_dir')
337+
# def _update_notebook_dir(self, change):
338+
# """Do a bit of validation of the notebook dir."""
339+
# # setting App.notebook_dir implies setting notebook and kernel dirs as well
340+
# new = change['new']
341+
# self.config.FileContentsManager.root_dir = new
342+
# self.config.MappingKernelManager.root_dir = new
343343

344344
nbserver_extensions = Dict({}, config=True,
345345
help=(_("Dict of Python modules to load as notebook server extensions."

0 commit comments

Comments
 (0)