##// END OF EJS Templates
minor notebook-dir config adjustments...
MinRK -
Show More
@@ -396,8 +396,13 b' class NotebookApp(BaseIPythonApplication):'
396 self.kernel_argv.append("--KernelApp.parent_appname='%s'"%self.name)
396 self.kernel_argv.append("--KernelApp.parent_appname='%s'"%self.name)
397
397
398 if self.extra_args:
398 if self.extra_args:
399 self.file_to_run = os.path.abspath(self.extra_args[0])
399 f = os.path.abspath(self.extra_args[0])
400 self.config.NotebookManager.notebook_dir = os.path.dirname(self.file_to_run)
400 if os.path.isdir(f):
401 nbdir = f
402 else:
403 self.file_to_run = f
404 nbdir = os.path.dirname(f)
405 self.config.NotebookManager.notebook_dir = nbdir
401
406
402 def init_configurables(self):
407 def init_configurables(self):
403 # force Session default to be secure
408 # force Session default to be secure
@@ -408,6 +413,7 b' class NotebookApp(BaseIPythonApplication):'
408 connection_dir = self.profile_dir.security_dir,
413 connection_dir = self.profile_dir.security_dir,
409 )
414 )
410 self.notebook_manager = NotebookManager(config=self.config, log=self.log)
415 self.notebook_manager = NotebookManager(config=self.config, log=self.log)
416 self.log.info("Serving notebooks from %s", self.notebook_manager.notebook_dir)
411 self.notebook_manager.list_notebooks()
417 self.notebook_manager.list_notebooks()
412 self.cluster_manager = ClusterManager(config=self.config, log=self.log)
418 self.cluster_manager = ClusterManager(config=self.config, log=self.log)
413 self.cluster_manager.update_profiles()
419 self.cluster_manager.update_profiles()
@@ -544,7 +550,7 b' class NotebookApp(BaseIPythonApplication):'
544 (proto, ip, self.port,self.base_project_url) )
550 (proto, ip, self.port,self.base_project_url) )
545 info("Use Control-C to stop this server and shut down all kernels.")
551 info("Use Control-C to stop this server and shut down all kernels.")
546
552
547 if self.open_browser:
553 if self.open_browser or self.file_to_run:
548 ip = self.ip or '127.0.0.1'
554 ip = self.ip or '127.0.0.1'
549 if self.browser:
555 if self.browser:
550 browser = webbrowser.get(self.browser)
556 browser = webbrowser.get(self.browser)
General Comments 0
You need to be logged in to leave comments. Login now