@@ -306,40 +306,40 @@ def _default_browser_open_file(self):
306
306
basename = "nbserver-%s-open.html" % os .getpid ()
307
307
return os .path .join (self .runtime_dir , basename )
308
308
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
343
343
344
344
nbserver_extensions = Dict ({}, config = True ,
345
345
help = (_ ("Dict of Python modules to load as notebook server extensions."
0 commit comments