##// END OF EJS Templates
Minimal updates to pure Python kernel to keep it (somewhat) API compatible with the IPython Kernel....
epatters -
Show More
@@ -36,6 +36,12 b' from session import Session, Message'
36
36
37 class Kernel(HasTraits):
37 class Kernel(HasTraits):
38
38
39 # Private interface
40
41 # This is a dict of port number that the kernel is listening on. It is set
42 # by record_ports and used by connect_request.
43 _recorded_ports = None
44
39 #---------------------------------------------------------------------------
45 #---------------------------------------------------------------------------
40 # Kernel interface
46 # Kernel interface
41 #---------------------------------------------------------------------------
47 #---------------------------------------------------------------------------
@@ -75,6 +81,19 b' class Kernel(HasTraits):'
75 else:
81 else:
76 handler(ident, omsg)
82 handler(ident, omsg)
77
83
84 def record_ports(self, xrep_port, pub_port, req_port, hb_port):
85 """Record the ports that this kernel is using.
86
87 The creator of the Kernel instance must call this methods if they
88 want the :meth:`connect_request` method to return the port numbers.
89 """
90 self._recorded_ports = {
91 'xrep_port' : xrep_port,
92 'pub_port' : pub_port,
93 'req_port' : req_port,
94 'hb_port' : hb_port
95 }
96
78 #---------------------------------------------------------------------------
97 #---------------------------------------------------------------------------
79 # Kernel request handlers
98 # Kernel request handlers
80 #---------------------------------------------------------------------------
99 #---------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now