diff --git a/examples/lib/internal_ipkernel.py b/examples/lib/internal_ipkernel.py index d3ee57c..db434bd 100644 --- a/examples/lib/internal_ipkernel.py +++ b/examples/lib/internal_ipkernel.py @@ -10,11 +10,11 @@ from IPython.kernel.zmq.kernelapp import IPKernelApp #----------------------------------------------------------------------------- # Functions and classes #----------------------------------------------------------------------------- -def pylab_kernel(gui): - """Launch and return an IPython kernel with pylab support for the desired gui +def mpl_kernel(gui): + """Launch and return an IPython kernel with matplotlib support for the desired gui """ kernel = IPKernelApp.instance() - kernel.initialize(['python', '--pylab=%s' % gui, + kernel.initialize(['python', '--matplotlib=%s' % gui, #'--log-level=10' ]) return kernel @@ -23,16 +23,13 @@ def pylab_kernel(gui): class InternalIPKernel(object): def init_ipkernel(self, backend): - # Start IPython kernel with GUI event loop and pylab support - self.ipkernel = pylab_kernel(backend) + # Start IPython kernel with GUI event loop and mpl support + self.ipkernel = mpl_kernel(backend) # To create and track active qt consoles self.consoles = [] # This application will also act on the shell user namespace self.namespace = self.ipkernel.shell.user_ns - # Keys present at startup so we don't print the entire pylab/numpy - # namespace when the user clicks the 'namespace' button - self._init_keys = set(self.namespace.keys()) # Example: a variable that will be seen by the user in the shell, and # that the GUI modifies (the 'Counter++' button increments it): @@ -42,7 +39,7 @@ class InternalIPKernel(object): def print_namespace(self, evt=None): print("\n***Variables in User namespace***") for k, v in self.namespace.items(): - if k not in self._init_keys and not k.startswith('_'): + if not k.startswith('_'): print('%s -> %r' % (k, v)) sys.stdout.flush()