From a92b812800a97806c48252b7e8ab842ba953f44f 2012-01-31 01:32:37 From: Scott Tsai Date: 2012-01-31 01:32:37 Subject: [PATCH] zmq.Kernel: turn user_{module,ns} into traitlets --- diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index 9626a5c..4826c26 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -70,6 +70,8 @@ class Kernel(Configurable): iopub_socket = Instance('zmq.Socket') stdin_socket = Instance('zmq.Socket') log = Instance(logging.Logger) + user_module = Instance('types.ModuleType') + user_ns = Dict(default_value=None) # Private interface @@ -100,7 +102,7 @@ class Kernel(Configurable): - def __init__(self, user_module=None, user_ns=None, **kwargs): + def __init__(self, **kwargs): super(Kernel, self).__init__(**kwargs) # Before we even start up the shell, register *first* our exit handlers @@ -110,8 +112,8 @@ class Kernel(Configurable): # Initialize the InteractiveShell subclass self.shell = ZMQInteractiveShell.instance(config=self.config, profile_dir = self.profile_dir, - user_module=user_module, - user_ns=user_ns, + user_module = self.user_module, + user_ns = self.user_ns, ) self.shell.displayhook.session = self.session self.shell.displayhook.pub_socket = self.iopub_socket