##// END OF EJS Templates
%profile points to application value, not shell value...
MinRK -
Show More
@@ -527,7 +527,11 b' Currently the magic system has the following functions:\\n"""'
527
527
528 def magic_profile(self, parameter_s=''):
528 def magic_profile(self, parameter_s=''):
529 """Print your currently active IPython profile."""
529 """Print your currently active IPython profile."""
530 print self.shell.profile
530 from IPython.core.application import BaseIPythonApplication
531 if BaseIPythonApplication.initialized():
532 print BaseIPythonApplication.instance().profile
533 else:
534 error("profile is an application-level value, but you don't appear to be in an IPython application")
531
535
532 def magic_pinfo(self, parameter_s='', namespaces=None):
536 def magic_pinfo(self, parameter_s='', namespaces=None):
533 """Provide detailed information about an object.
537 """Provide detailed information about an object.
@@ -64,6 +64,7 b' class Kernel(Configurable):'
64
64
65 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
65 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
66 session = Instance(Session)
66 session = Instance(Session)
67 profile_dir = Instance('IPython.core.profiledir.ProfileDir')
67 shell_socket = Instance('zmq.Socket')
68 shell_socket = Instance('zmq.Socket')
68 iopub_socket = Instance('zmq.Socket')
69 iopub_socket = Instance('zmq.Socket')
69 stdin_socket = Instance('zmq.Socket')
70 stdin_socket = Instance('zmq.Socket')
@@ -106,7 +107,9 b' class Kernel(Configurable):'
106 atexit.register(self._at_shutdown)
107 atexit.register(self._at_shutdown)
107
108
108 # Initialize the InteractiveShell subclass
109 # Initialize the InteractiveShell subclass
109 self.shell = ZMQInteractiveShell.instance(config=self.config)
110 self.shell = ZMQInteractiveShell.instance(config=self.config,
111 profile_dir = self.profile_dir,
112 )
110 self.shell.displayhook.session = self.session
113 self.shell.displayhook.session = self.session
111 self.shell.displayhook.pub_socket = self.iopub_socket
114 self.shell.displayhook.pub_socket = self.iopub_socket
112 self.shell.display_pub.session = self.session
115 self.shell.display_pub.session = self.session
@@ -739,16 +742,16 b' class IPKernelApp(KernelApp, InteractiveShellApp):'
739 self.init_code()
742 self.init_code()
740
743
741 def init_kernel(self):
744 def init_kernel(self):
742 kernel_factory = Kernel
743
745
744 if self.pylab:
746 if self.pylab:
745 gui, backend = pylabtools.find_gui_and_backend(self.pylab)
747 gui, backend = pylabtools.find_gui_and_backend(self.pylab)
746
748
747 kernel = kernel_factory(config=self.config, session=self.session,
749 kernel = Kernel(config=self.config, session=self.session,
748 shell_socket=self.shell_socket,
750 shell_socket=self.shell_socket,
749 iopub_socket=self.iopub_socket,
751 iopub_socket=self.iopub_socket,
750 stdin_socket=self.stdin_socket,
752 stdin_socket=self.stdin_socket,
751 log=self.log,
753 log=self.log,
754 profile_dir=self.profile_dir,
752 )
755 )
753 self.kernel = kernel
756 self.kernel = kernel
754 kernel.record_ports(self.ports)
757 kernel.record_ports(self.ports)
General Comments 0
You need to be logged in to leave comments. Login now