Show More
@@ -257,6 +257,9 b' class NotebookApp(BaseIPythonApplication):' | |||
|
257 | 257 | # create requested profiles by default, if they don't exist: |
|
258 | 258 | auto_create = Bool(True) |
|
259 | 259 | |
|
260 | # file to be opened in the notebook server | |
|
261 | file_to_run = Unicode('') | |
|
262 | ||
|
260 | 263 | # Network related information. |
|
261 | 264 | |
|
262 | 265 | ip = Unicode(LOCALHOST, config=True, |
@@ -376,6 +379,10 b' class NotebookApp(BaseIPythonApplication):' | |||
|
376 | 379 | # Kernel should inherit default config file from frontend |
|
377 | 380 | self.kernel_argv.append("--KernelApp.parent_appname='%s'"%self.name) |
|
378 | 381 | |
|
382 | if self.extra_args: | |
|
383 | self.file_to_run = os.path.abspath(self.extra_args[0]) | |
|
384 | self.config.NotebookManager.notebook_dir = os.path.dirname(self.file_to_run) | |
|
385 | ||
|
379 | 386 | def init_configurables(self): |
|
380 | 387 | # force Session default to be secure |
|
381 | 388 | default_secure(self.config) |
@@ -524,9 +531,20 b' class NotebookApp(BaseIPythonApplication):' | |||
|
524 | 531 | browser = webbrowser.get(self.browser) |
|
525 | 532 | else: |
|
526 | 533 | browser = webbrowser.get() |
|
527 | b = lambda : browser.open("%s://%s:%i%s" % (proto, ip, self.port, | |
|
528 | self.base_project_url), | |
|
529 | new=2) | |
|
534 | ||
|
535 | if self.file_to_run: | |
|
536 | filename, _ = os.path.splitext(os.path.basename(self.file_to_run)) | |
|
537 | for nb in self.notebook_manager.list_notebooks(): | |
|
538 | if filename == nb['name']: | |
|
539 | url = nb['notebook_id'] | |
|
540 | break | |
|
541 | else: | |
|
542 | url = '' | |
|
543 | else: | |
|
544 | url = '' | |
|
545 | b = lambda : browser.open("%s://%s:%i%s%s" % (proto, ip, | |
|
546 | self.port, self.base_project_url, url), | |
|
547 | new=2) | |
|
530 | 548 | threading.Thread(target=b).start() |
|
531 | 549 | try: |
|
532 | 550 | ioloop.IOLoop.instance().start() |
General Comments 0
You need to be logged in to leave comments.
Login now