Allow FileContentsManager and MappingKernelManager to be used outside NotebookApp

Thomas Kluyver 12 years ago
parent 6d776a5292
commit 8252f56b00

@ -26,7 +26,10 @@ class FileContentsManager(ContentsManager):
root_dir = Unicode(config=True)
def _root_dir_default(self):
return self.parent.notebook_dir
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):
return self.parent.notebook_dir
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…
Cancel
Save