mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
Allow FileContentsManager and MappingKernelManager to be used outside NotebookApp
This commit is contained in:
parent
6d776a5292
commit
8252f56b00
@ -26,7 +26,10 @@ class FileContentsManager(ContentsManager):
|
||||
root_dir = Unicode(config=True)
|
||||
|
||||
def _root_dir_default(self):
|
||||
try:
|
||||
return self.parent.notebook_dir
|
||||
except AttributeError:
|
||||
return getcwd()
|
||||
|
||||
save_script = Bool(False, config=True, help='DEPRECATED, IGNORED')
|
||||
def _save_script_changed(self):
|
||||
|
@ -29,7 +29,10 @@ class MappingKernelManager(MultiKernelManager):
|
||||
root_dir = Unicode(config=True)
|
||||
|
||||
def _root_dir_default(self):
|
||||
try:
|
||||
return self.parent.notebook_dir
|
||||
except AttributeError:
|
||||
return getcwd()
|
||||
|
||||
def _root_dir_changed(self, name, old, new):
|
||||
"""Do a bit of validation of the root dir."""
|
||||
|
Loading…
Reference in New Issue
Block a user