Don't pass IPython-specific args to non-IPython kernels

add a few FIXME notes that the IPython-kernel special treatment
will probably want to be removed in the Jupyter explosion.
This commit is contained in:
Min RK 2014-11-17 11:17:08 -08:00
parent 89598450f7
commit 1914e27cff
2 changed files with 9 additions and 28 deletions

View File

@ -324,7 +324,7 @@ class NotebookApp(BaseIPythonApplication):
list=(NbserverListApp, NbserverListApp.description.splitlines()[0]),
)
kernel_argv = List(Unicode)
ipython_kernel_argv = List(Unicode)
_log_formatter_cls = LogFormatter
@ -683,16 +683,17 @@ class NotebookApp(BaseIPythonApplication):
self.update_config(c)
def init_kernel_argv(self):
"""construct the kernel arguments"""
"""add the profile-dir to arguments to be passed to IPython kernels"""
# FIXME: remove special treatment of IPython kernels
# Kernel should get *absolute* path to profile directory
self.kernel_argv = ["--profile-dir", self.profile_dir.location]
self.ipython_kernel_argv = ["--profile-dir", self.profile_dir.location]
def init_configurables(self):
# force Session default to be secure
default_secure(self.config)
kls = import_item(self.kernel_manager_class)
self.kernel_manager = kls(
parent=self, log=self.log, kernel_argv=self.kernel_argv,
parent=self, log=self.log, ipython_kernel_argv=self.ipython_kernel_argv,
connection_dir = self.profile_dir.security_dir,
)
kls = import_item(self.contents_manager_class)

View File

@ -1,35 +1,18 @@
"""A kernel manager relating notebooks and kernels
"""A kernel manager relating notebooks and kernels"""
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
from tornado import web
from IPython.kernel.multikernelmanager import MultiKernelManager
from IPython.utils.traitlets import List, Unicode, TraitError
from IPython.utils.traitlets import Unicode, TraitError
from IPython.html.utils import to_os_path
from IPython.utils.py3compat import getcwd
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
class MappingKernelManager(MultiKernelManager):
"""A KernelManager that handles notebook mapping and HTTP error handling"""
@ -37,8 +20,6 @@ class MappingKernelManager(MultiKernelManager):
def _kernel_manager_class_default(self):
return "IPython.kernel.ioloop.IOLoopKernelManager"
kernel_argv = List(Unicode)
root_dir = Unicode(getcwd(), config=True)
def _root_dir_changed(self, name, old, new):
@ -89,7 +70,6 @@ class MappingKernelManager(MultiKernelManager):
an existing kernel is returned, but it may be checked in the future.
"""
if kernel_id is None:
kwargs['extra_arguments'] = self.kernel_argv
if path is not None:
kwargs['cwd'] = self.cwd_for_path(path)
kernel_id = super(MappingKernelManager, self).start_kernel(