Show More
@@ -253,7 +253,7 b' aliases.update({' | |||||
253 | aliases.pop('f', None) |
|
253 | aliases.pop('f', None) | |
254 |
|
254 | |||
255 | notebook_aliases = [u'port', u'port-retries', u'ip', u'keyfile', u'certfile', |
|
255 | notebook_aliases = [u'port', u'port-retries', u'ip', u'keyfile', u'certfile', | |
256 | u'notebook-dir'] |
|
256 | u'notebook-dir', u'profile', u'profile-dir'] | |
257 |
|
257 | |||
258 | #----------------------------------------------------------------------------- |
|
258 | #----------------------------------------------------------------------------- | |
259 | # NotebookApp |
|
259 | # NotebookApp | |
@@ -471,17 +471,10 b' class NotebookApp(BaseIPythonApplication):' | |||||
471 | help=("Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-For headers" |
|
471 | help=("Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-For headers" | |
472 | "sent by the upstream reverse proxy. Neccesary if the proxy handles SSL") |
|
472 | "sent by the upstream reverse proxy. Neccesary if the proxy handles SSL") | |
473 | ) |
|
473 | ) | |
474 |
|
474 | |||
475 | def parse_command_line(self, argv=None): |
|
475 | def parse_command_line(self, argv=None): | |
476 | super(NotebookApp, self).parse_command_line(argv) |
|
476 | super(NotebookApp, self).parse_command_line(argv) | |
477 | if argv is None: |
|
477 | ||
478 | argv = sys.argv[1:] |
|
|||
479 |
|
||||
480 | # Scrub frontend-specific flags |
|
|||
481 | self.kernel_argv = swallow_argv(argv, notebook_aliases, notebook_flags) |
|
|||
482 | # Kernel should inherit default config file from frontend |
|
|||
483 | self.kernel_argv.append("--IPKernelApp.parent_appname='%s'" % self.name) |
|
|||
484 |
|
||||
485 | if self.extra_args: |
|
478 | if self.extra_args: | |
486 | f = os.path.abspath(self.extra_args[0]) |
|
479 | f = os.path.abspath(self.extra_args[0]) | |
487 | if os.path.isdir(f): |
|
480 | if os.path.isdir(f): | |
@@ -491,6 +484,15 b' class NotebookApp(BaseIPythonApplication):' | |||||
491 | nbdir = os.path.dirname(f) |
|
484 | nbdir = os.path.dirname(f) | |
492 | self.config.NotebookManager.notebook_dir = nbdir |
|
485 | self.config.NotebookManager.notebook_dir = nbdir | |
493 |
|
486 | |||
|
487 | def init_kernel_argv(self): | |||
|
488 | """construct the kernel arguments""" | |||
|
489 | # Scrub frontend-specific flags | |||
|
490 | self.kernel_argv = swallow_argv(self.argv, notebook_aliases, notebook_flags) | |||
|
491 | # Kernel should inherit default config file from frontend | |||
|
492 | self.kernel_argv.append("--IPKernelApp.parent_appname='%s'" % self.name) | |||
|
493 | # Kernel should get *absolute* path to profile directory | |||
|
494 | self.kernel_argv.extend(["--profile-dir", self.profile_dir.location]) | |||
|
495 | ||||
494 | def init_configurables(self): |
|
496 | def init_configurables(self): | |
495 | # force Session default to be secure |
|
497 | # force Session default to be secure | |
496 | default_secure(self.config) |
|
498 | default_secure(self.config) | |
@@ -657,6 +659,7 b' class NotebookApp(BaseIPythonApplication):' | |||||
657 | def initialize(self, argv=None): |
|
659 | def initialize(self, argv=None): | |
658 | self.init_logging() |
|
660 | self.init_logging() | |
659 | super(NotebookApp, self).initialize(argv) |
|
661 | super(NotebookApp, self).initialize(argv) | |
|
662 | self.init_kernel_argv() | |||
660 | self.init_configurables() |
|
663 | self.init_configurables() | |
661 | self.init_components() |
|
664 | self.init_components() | |
662 | self.init_webapp() |
|
665 | self.init_webapp() |
General Comments 0
You need to be logged in to leave comments.
Login now