Show More
@@ -316,15 +316,22 b' class IPEngineApp(BaseParallelApplication):' | |||||
316 |
|
316 | |||
317 |
|
317 | |||
318 | try: |
|
318 | try: | |
319 | exec_lines = config.Kernel.exec_lines |
|
319 | exec_lines = config.IPKernelApp.exec_lines | |
320 | except AttributeError: |
|
320 | except AttributeError: | |
321 | config.Kernel.exec_lines = [] |
|
321 | try: | |
322 |
exec_lines = config. |
|
322 | exec_lines = config.InteractiveShellApp.exec_lines | |
|
323 | except AttributeError: | |||
|
324 | exec_lines = config.IPKernelApp.exec_lines = [] | |||
|
325 | try: | |||
|
326 | exec_files = config.IPKernelApp.exec_files | |||
|
327 | except AttributeError: | |||
|
328 | try: | |||
|
329 | exec_files = config.InteractiveShellApp.exec_files | |||
|
330 | except AttributeError: | |||
|
331 | exec_files = config.IPKernelApp.exec_files = [] | |||
323 |
|
332 | |||
324 | if self.startup_script: |
|
333 | if self.startup_script: | |
325 | enc = sys.getfilesystemencoding() or 'utf8' |
|
334 | exec_files.append(self.startup_script) | |
326 | cmd="execfile(%r)" % self.startup_script.encode(enc) |
|
|||
327 | exec_lines.append(cmd) |
|
|||
328 | if self.startup_command: |
|
335 | if self.startup_command: | |
329 | exec_lines.append(self.startup_command) |
|
336 | exec_lines.append(self.startup_command) | |
330 |
|
337 |
@@ -34,7 +34,7 b' from IPython.parallel.factory import RegistrationFactory' | |||||
34 | from IPython.parallel.util import disambiguate_url |
|
34 | from IPython.parallel.util import disambiguate_url | |
35 |
|
35 | |||
36 | from IPython.zmq.session import Message |
|
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 | class EngineFactory(RegistrationFactory): |
|
39 | class EngineFactory(RegistrationFactory): | |
40 | """IPython engine""" |
|
40 | """IPython engine""" | |
@@ -198,10 +198,15 b' class EngineFactory(RegistrationFactory):' | |||||
198 | self.kernel = Kernel(config=self.config, int_id=self.id, ident=self.ident, session=self.session, |
|
198 | self.kernel = Kernel(config=self.config, int_id=self.id, ident=self.ident, session=self.session, | |
199 | control_stream=control_stream, shell_streams=shell_streams, iopub_socket=iopub_socket, |
|
199 | control_stream=control_stream, shell_streams=shell_streams, iopub_socket=iopub_socket, | |
200 | loop=loop, user_ns=self.user_ns, log=self.log) |
|
200 | loop=loop, user_ns=self.user_ns, log=self.log) | |
|
201 | ||||
201 | self.kernel.shell.display_pub.topic = cast_bytes('engine.%i.displaypub' % self.id) |
|
202 | self.kernel.shell.display_pub.topic = cast_bytes('engine.%i.displaypub' % self.id) | |
|
203 | ||||
|
204 | # FIXME: This is a hack until IPKernelApp and IPEngineApp can be fully merged | |||
|
205 | app = IPKernelApp(config=self.config, shell=self.kernel.shell, kernel=self.kernel, log=self.log) | |||
|
206 | app.init_profile_dir() | |||
|
207 | app.init_code() | |||
|
208 | ||||
202 | self.kernel.start() |
|
209 | self.kernel.start() | |
203 |
|
||||
204 |
|
||||
205 | else: |
|
210 | else: | |
206 | self.log.fatal("Registration Failed: %s"%msg) |
|
211 | self.log.fatal("Registration Failed: %s"%msg) | |
207 | raise Exception("Registration Failed: %s"%msg) |
|
212 | raise Exception("Registration Failed: %s"%msg) |
General Comments 0
You need to be logged in to leave comments.
Login now