##// END OF EJS Templates
Only import zeromq pieces in networked shells.
Fernando Perez -
Show More
@@ -253,7 +253,7 b' def import_pylab(user_ns, import_all=True):'
253 exec s in user_ns
253 exec s in user_ns
254
254
255
255
256 def configure_shell(shell, backend, user_ns=None):
256 def configure_inline_backend(shell, user_ns=None):
257 """Configure an IPython shell object for matplotlib use.
257 """Configure an IPython shell object for matplotlib use.
258
258
259 Parameters
259 Parameters
@@ -280,14 +280,13 b' def configure_shell(shell, backend, user_ns=None):'
280 if cfg not in shell.configurables:
280 if cfg not in shell.configurables:
281 shell.configurables.append(cfg)
281 shell.configurables.append(cfg)
282
282
283 if backend == backends['inline']:
283 from IPython.zmq.pylab.backend_inline import flush_figures
284 from IPython.zmq.pylab.backend_inline import flush_figures
284 from matplotlib import pyplot
285 from matplotlib import pyplot
285 shell.register_post_execute(flush_figures)
286 shell.register_post_execute(flush_figures)
286 # load inline_rc
287 # load inline_rc
287 pyplot.rcParams.update(cfg.rc)
288 pyplot.rcParams.update(cfg.rc)
288 # Add 'figsize' to pyplot and to the user's namespace
289 # Add 'figsize' to pyplot and to the user's namespace
289 user_ns['figsize'] = pyplot.figsize = figsize
290 user_ns['figsize'] = pyplot.figsize = figsize
291
290
292 # Setup the default figure format
291 # Setup the default figure format
293 fmt = cfg.figure_format
292 fmt = cfg.figure_format
@@ -324,7 +323,11 b' def pylab_activate(user_ns, gui=None, import_all=True, shell=None):'
324 gui, backend = find_gui_and_backend(gui)
323 gui, backend = find_gui_and_backend(gui)
325 activate_matplotlib(backend)
324 activate_matplotlib(backend)
326 import_pylab(user_ns, import_all)
325 import_pylab(user_ns, import_all)
327 configure_shell(shell, backend, user_ns)
326
327 # The inline backend is only used by GUI shells
328 if backend == backends['inline']:
329 configure_inline_backend(shell, backend, user_ns)
330
328 print """
331 print """
329 Welcome to pylab, a matplotlib-based Python environment [backend: %s].
332 Welcome to pylab, a matplotlib-based Python environment [backend: %s].
330 For more information, type 'help(pylab)'.""" % backend
333 For more information, type 'help(pylab)'.""" % backend
General Comments 0
You need to be logged in to leave comments. Login now