Show More
@@ -332,12 +332,12 b' class NotebookApp(BaseIPythonApplication):' | |||||
332 | auto_create = Bool(True) |
|
332 | auto_create = Bool(True) | |
333 |
|
333 | |||
334 | # file to be opened in the notebook server |
|
334 | # file to be opened in the notebook server | |
335 | file_to_run = Unicode('') |
|
335 | file_to_run = Unicode('', config=True) | |
336 | def _file_to_run_changed(self, name, old, new): |
|
336 | def _file_to_run_changed(self, name, old, new): | |
337 | path, base = os.path.split(new) |
|
337 | path, base = os.path.split(new) | |
338 | if path: |
|
338 | if path: | |
339 | self.file_to_run = base |
|
339 | self.file_to_run = base | |
340 | self.notebook_dir = path |
|
340 | self.notebook_dir = path | |
341 |
|
341 | |||
342 | # Network related information. |
|
342 | # Network related information. | |
343 |
|
343 | |||
@@ -550,15 +550,13 b' class NotebookApp(BaseIPythonApplication):' | |||||
550 | if not os.path.exists(f): |
|
550 | if not os.path.exists(f): | |
551 | self.log.critical("No such file or directory: %s", f) |
|
551 | self.log.critical("No such file or directory: %s", f) | |
552 | self.exit(1) |
|
552 | self.exit(1) | |
|
553 | ||||
|
554 | # Use config here, to ensure that it takes higher priority than | |||
|
555 | # anything that comes from the profile. | |||
553 | if os.path.isdir(f): |
|
556 | if os.path.isdir(f): | |
554 |
|
|
557 | self.config.NotebookApp.notebook_dir = f | |
555 | self.notebook_dir = f |
|
|||
556 | if old == self.notebook_dir: |
|
|||
557 | # force trigger on-change event if it didn't fire, |
|
|||
558 | # so that descendent config fires |
|
|||
559 | self._notebook_dir_changed('notebook_dir', old, self.notebook_dir) |
|
|||
560 | elif os.path.isfile(f): |
|
558 | elif os.path.isfile(f): | |
561 | self.file_to_run = f |
|
559 | self.config.NotebookApp.file_to_run = f | |
562 |
|
560 | |||
563 | def init_kernel_argv(self): |
|
561 | def init_kernel_argv(self): | |
564 | """construct the kernel arguments""" |
|
562 | """construct the kernel arguments""" |
General Comments 0
You need to be logged in to leave comments.
Login now