##// END OF EJS Templates
Allow FileContentsManager and MappingKernelManager to be used outside NotebookApp
Thomas Kluyver -
Show More
@@ -26,7 +26,10 b' class FileContentsManager(ContentsManager):'
26 root_dir = Unicode(config=True)
26 root_dir = Unicode(config=True)
27
27
28 def _root_dir_default(self):
28 def _root_dir_default(self):
29 return self.parent.notebook_dir
29 try:
30 return self.parent.notebook_dir
31 except AttributeError:
32 return getcwd()
30
33
31 save_script = Bool(False, config=True, help='DEPRECATED, IGNORED')
34 save_script = Bool(False, config=True, help='DEPRECATED, IGNORED')
32 def _save_script_changed(self):
35 def _save_script_changed(self):
@@ -29,7 +29,10 b' class MappingKernelManager(MultiKernelManager):'
29 root_dir = Unicode(config=True)
29 root_dir = Unicode(config=True)
30
30
31 def _root_dir_default(self):
31 def _root_dir_default(self):
32 return self.parent.notebook_dir
32 try:
33 return self.parent.notebook_dir
34 except AttributeError:
35 return getcwd()
33
36
34 def _root_dir_changed(self, name, old, new):
37 def _root_dir_changed(self, name, old, new):
35 """Do a bit of validation of the root dir."""
38 """Do a bit of validation of the root dir."""
General Comments 0
You need to be logged in to leave comments. Login now