##// END OF EJS Templates
allow KM._launch_kernel to be overridden in subclasses
MinRK -
Show More
@@ -909,7 +909,14 b' class KernelManager(Configurable):'
909 ns = dict(connection_file=self.connection_file)
909 ns = dict(connection_file=self.connection_file)
910 ns.update(self._launch_args)
910 ns.update(self._launch_args)
911 return [ c.format(**ns) for c in cmd ]
911 return [ c.format(**ns) for c in cmd ]
912
912
913 def _launch_kernel(self, kernel_cmd, **kw):
914 """actually launch the kernel
915
916 override in a subclass to launch kernel subprocesses differently
917 """
918 return launch_kernel(kernel_cmd, **kw)
919
913 def start_kernel(self, **kw):
920 def start_kernel(self, **kw):
914 """Starts a kernel on this host in a separate process.
921 """Starts a kernel on this host in a separate process.
915
922
@@ -941,9 +948,10 b' class KernelManager(Configurable):'
941 self._launch_args = kw.copy()
948 self._launch_args = kw.copy()
942 # build the Popen cmd
949 # build the Popen cmd
943 kernel_cmd = self.format_kernel_cmd(**kw)
950 kernel_cmd = self.format_kernel_cmd(**kw)
944 print kernel_cmd
945 # launch the kernel subprocess
951 # launch the kernel subprocess
946 self.kernel = launch_kernel(kernel_cmd, ipython_kernel=self.ipython_kernel, **kw)
952 self.kernel = self._launch_kernel(kernel_cmd,
953 ipython_kernel=self.ipython_kernel,
954 **kw)
947
955
948 def shutdown_kernel(self, now=False, restart=False):
956 def shutdown_kernel(self, now=False, restart=False):
949 """Attempts to the stop the kernel process cleanly.
957 """Attempts to the stop the kernel process cleanly.
General Comments 0
You need to be logged in to leave comments. Login now