diff --git a/IPython/zmq/kernelmanager.py b/IPython/zmq/kernelmanager.py index c09dba5..4981f10 100644 --- a/IPython/zmq/kernelmanager.py +++ b/IPython/zmq/kernelmanager.py @@ -425,10 +425,10 @@ class KernelManager(HasTraits): frontend. """ # The PyZMQ Context to use for communication with the kernel. - context = Instance(zmq.Context) + context = Instance(zmq.Context,(),{}) # The Session to use for communication with the kernel. - session = Instance(Session) + session = Instance(Session,(),{}) # The kernel process with which the KernelManager is communicating. kernel = Instance(Popen) @@ -439,22 +439,15 @@ class KernelManager(HasTraits): rep_channel_class = Type(RepSocketChannel) # Protected traits. - _xreq_address = TCPAddress - _sub_address = TCPAddress - _rep_address = TCPAddress + xreq_address = TCPAddress((LOCALHOST, 0)) + sub_address = TCPAddress((LOCALHOST, 0)) + rep_address = TCPAddress((LOCALHOST, 0)) _xreq_channel = Any _sub_channel = Any _rep_channel = Any - def __init__(self, xreq_address=None, sub_address=None, rep_address=None, - context=None, session=None): - super(KernelManager, self).__init__() - self._xreq_address = (LOCALHOST, 0) if xreq_address is None else xreq_address - self._sub_address = (LOCALHOST, 0) if sub_address is None else sub_address - self._rep_address = (LOCALHOST, 0) if rep_address is None else rep_address - self.context = zmq.Context() if context is None else context - self.session = Session() if session is None else session - super(KernelManager, self).__init__() + def __init__(self, **kwargs): + super(KernelManager, self).__init__(**kwargs) #--------------------------------- ----------------------------------------- # Channel management methods: @@ -507,9 +500,9 @@ class KernelManager(HasTraits): self.kernel, xrep, pub, req = launch_kernel( xrep_port=xreq[1], pub_port=sub[1], req_port=rep[1]) - self._xreq_address = (LOCALHOST, xrep) - self._sub_address = (LOCALHOST, pub) - self._rep_address = (LOCALHOST, req) + self.xreq_address = (LOCALHOST, xrep) + self.sub_address = (LOCALHOST, pub) + self.rep_address = (LOCALHOST, req) @property def has_kernel(self): @@ -576,16 +569,3 @@ class KernelManager(HasTraits): self.session, self.rep_address) return self._rep_channel - - @property - def xreq_address(self): - return self._xreq_address - - @property - def sub_address(self): - return self._sub_address - - @property - def rep_address(self): - return self._rep_address -