##// END OF EJS Templates
Backport PR #2214: use KernelApp.exec_lines/files in IPEngineApp...
MinRK -
Show More
@@ -304,15 +304,22 b' class IPEngineApp(BaseParallelApplication):'
304 304
305 305
306 306 try:
307 exec_lines = config.Kernel.exec_lines
307 exec_lines = config.IPKernelApp.exec_lines
308 308 except AttributeError:
309 config.Kernel.exec_lines = []
310 exec_lines = config.Kernel.exec_lines
309 try:
310 exec_lines = config.InteractiveShellApp.exec_lines
311 except AttributeError:
312 exec_lines = config.IPKernelApp.exec_lines = []
313 try:
314 exec_files = config.IPKernelApp.exec_files
315 except AttributeError:
316 try:
317 exec_files = config.InteractiveShellApp.exec_files
318 except AttributeError:
319 exec_files = config.IPKernelApp.exec_files = []
311 320
312 321 if self.startup_script:
313 enc = sys.getfilesystemencoding() or 'utf8'
314 cmd="execfile(%r)" % self.startup_script.encode(enc)
315 exec_lines.append(cmd)
322 exec_files.append(self.startup_script)
316 323 if self.startup_command:
317 324 exec_lines.append(self.startup_command)
318 325
@@ -34,7 +34,7 b' from IPython.parallel.factory import RegistrationFactory'
34 34 from IPython.parallel.util import disambiguate_url
35 35
36 36 from IPython.zmq.session import Message
37 from IPython.zmq.ipkernel import Kernel
37 from IPython.zmq.ipkernel import Kernel, IPKernelApp
38 38
39 39 class EngineFactory(RegistrationFactory):
40 40 """IPython engine"""
@@ -204,10 +204,15 b' class EngineFactory(RegistrationFactory):'
204 204 self.kernel = Kernel(config=self.config, int_id=self.id, ident=self.ident, session=self.session,
205 205 control_stream=control_stream, shell_streams=shell_streams, iopub_socket=iopub_socket,
206 206 loop=loop, user_ns=self.user_ns, log=self.log)
207
207 208 self.kernel.shell.display_pub.topic = cast_bytes('engine.%i.displaypub' % self.id)
208 self.kernel.start()
209 209
210 # FIXME: This is a hack until IPKernelApp and IPEngineApp can be fully merged
211 app = IPKernelApp(config=self.config, shell=self.kernel.shell, kernel=self.kernel, log=self.log)
212 app.init_profile_dir()
213 app.init_code()
210 214
215 self.kernel.start()
211 216 else:
212 217 self.log.fatal("Registration Failed: %s"%msg)
213 218 raise Exception("Registration Failed: %s"%msg)
General Comments 0
You need to be logged in to leave comments. Login now