##// END OF EJS Templates
BUG: Make Shell use the new make_user_namespaces API.
Robert Kern -
Show More
@@ -510,7 +510,7 b' class MatplotlibShellBase:'
510 510 Given Python's MRO, this should be used as the FIRST class in the
511 511 inheritance hierarchy, so that it overrides the relevant methods."""
512 512
513 def _matplotlib_config(self,name,user_ns):
513 def _matplotlib_config(self,name,user_ns,user_global_ns=None):
514 514 """Return items needed to setup the user's shell with matplotlib"""
515 515
516 516 # Initialize matplotlib to interactive mode always
@@ -564,7 +564,8 b' class MatplotlibShellBase:'
564 564 self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)
565 565
566 566 # Build a user namespace initialized with matplotlib/matlab features.
567 user_ns = IPython.ipapi.make_user_ns(user_ns)
567 user_ns, user_global_ns = IPython.ipapi.make_user_namespaces(user_ns,
568 user_global_ns)
568 569
569 570 # Import numpy as np/pyplot as plt are conventions we're trying to
570 571 # somewhat standardize on. Making them available to users by default
@@ -584,7 +585,7 b' class MatplotlibShellBase:'
584 585 Welcome to pylab, a matplotlib-based Python environment.
585 586 For more information, type 'help(pylab)'.
586 587 """
587 return user_ns,b
588 return user_ns,,user_global_ns,b
588 589
589 590 def mplot_exec(self,fname,*where,**kw):
590 591 """Execute a matplotlib script.
@@ -624,7 +625,7 b' class MatplotlibShell(MatplotlibShellBase,InteractiveShell):'
624 625
625 626 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
626 627 user_ns=None,user_global_ns=None,**kw):
627 user_ns,b2 = self._matplotlib_config(name,user_ns)
628 user_ns,user_global_ns,b2 = self._matplotlib_config(name,user_ns,user_global_ns)
628 629 InteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
629 630 banner2=b2,**kw)
630 631
General Comments 0
You need to be logged in to leave comments. Login now