Allow FileContentsManager and MappingKernelManager to be used outside NotebookApp

This commit is contained in:
Thomas Kluyver 2014-11-17 13:39:58 -08:00
parent 6d776a5292
commit 8252f56b00
2 changed files with 8 additions and 2 deletions

View File

@ -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):

View File

@ -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."""