##// END OF EJS Templates
finish plumbing config to Session objects...
MinRK -
Show More
@@ -30,6 +30,7 b' from IPython.zmq.ipkernel import ('
30 30 aliases as ipkernel_aliases,
31 31 IPKernelApp
32 32 )
33 from IPython.zmq.session import Session
33 34 from IPython.zmq.zmqshell import ZMQInteractiveShell
34 35
35 36
@@ -214,7 +215,7 b' aliases.update(dict('
214 215 class IPythonQtConsoleApp(BaseIPythonApplication):
215 216 name = 'ipython-qtconsole'
216 217 default_config_file_name='ipython_config.py'
217 classes = [IPKernelApp, IPythonWidget, ZMQInteractiveShell, ProfileDir]
218 classes = [IPKernelApp, IPythonWidget, ZMQInteractiveShell, ProfileDir, Session]
218 219 flags = Dict(flags)
219 220 aliases = Dict(aliases)
220 221
@@ -289,7 +290,8 b' class IPythonQtConsoleApp(BaseIPythonApplication):'
289 290 shell_address=(self.ip, self.shell_port),
290 291 sub_address=(self.ip, self.iopub_port),
291 292 stdin_address=(self.ip, self.stdin_port),
292 hb_address=(self.ip, self.hb_port)
293 hb_address=(self.ip, self.hb_port),
294 config=self.config
293 295 )
294 296 # start the kernel
295 297 if not self.existing:
@@ -590,7 +590,7 b' class IPKernelApp(KernelApp, InteractiveShellApp):'
590 590
591 591 aliases = Dict(aliases)
592 592 flags = Dict(flags)
593 classes = [Kernel, ZMQInteractiveShell, ProfileDir]
593 classes = [Kernel, ZMQInteractiveShell, ProfileDir, Session]
594 594 # configurables
595 595 pylab = CaselessStrEnum(['tk', 'qt', 'wx', 'gtk', 'osx', 'inline', 'auto'],
596 596 config=True,
@@ -73,7 +73,7 b' class KernelApp(BaseIPythonApplication):'
73 73 name='pykernel'
74 74 aliases = Dict(kernel_aliases)
75 75 flags = Dict(kernel_flags)
76
76 classes = [Session]
77 77 # the kernel class, as an importstring
78 78 kernel_class = Unicode('IPython.zmq.pykernel.Kernel')
79 79 kernel = Any()
@@ -163,7 +163,7 b' class KernelApp(BaseIPythonApplication):'
163 163
164 164 def init_session(self):
165 165 """create our session object"""
166 self.session = Session(username=u'kernel')
166 self.session = Session(config=self.config, username=u'kernel')
167 167
168 168 def init_io(self):
169 169 """redirects stdout/stderr, and installs a display hook"""
@@ -32,6 +32,7 b' from zmq import POLLIN, POLLOUT, POLLERR'
32 32 from zmq.eventloop import ioloop
33 33
34 34 # Local imports.
35 from IPython.config.loader import Config
35 36 from IPython.utils import io
36 37 from IPython.utils.localinterfaces import LOCALHOST, LOCAL_IPS
37 38 from IPython.utils.traitlets import HasTraits, Any, Instance, Type, TCPAddress
@@ -676,11 +677,16 b' class KernelManager(HasTraits):'
676 677 The REP channel is for the kernel to request stdin (raw_input) from the
677 678 frontend.
678 679 """
680 # config object for passing to child configurables
681 config = Instance(Config)
682
679 683 # The PyZMQ Context to use for communication with the kernel.
680 context = Instance(zmq.Context,(),{})
684 context = Instance(zmq.Context)
685 def _context_default(self):
686 return zmq.Context.instance()
681 687
682 688 # The Session to use for communication with the kernel.
683 session = Instance(Session,(),{})
689 session = Instance(Session)
684 690
685 691 # The kernel process with which the KernelManager is communicating.
686 692 kernel = Instance(Popen)
@@ -706,8 +712,10 b' class KernelManager(HasTraits):'
706 712
707 713 def __init__(self, **kwargs):
708 714 super(KernelManager, self).__init__(**kwargs)
715 if self.session is None:
716 self.session = Session(config=self.config)
709 717 # Uncomment this to try closing the context.
710 # atexit.register(self.context.close)
718 # atexit.register(self.context.term)
711 719
712 720 #--------------------------------------------------------------------------
713 721 # Channel management methods:
General Comments 0
You need to be logged in to leave comments. Login now