From a3555de3ffc6836e9943a4884d80925a223eb180 2011-09-12 16:48:46 From: Jens Hedegaard Nielsen Date: 2011-09-12 16:48:46 Subject: [PATCH] Make pylab magic respect the pylab_import_all config. Read from application if initialized. --- diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 8735c4d..751dedb 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -61,6 +61,7 @@ from IPython.utils.text import LSString, SList, format_screen from IPython.utils.timing import clock, clock2 from IPython.utils.warn import warn, error from IPython.utils.ipstruct import Struct +from IPython.config.application import Application #----------------------------------------------------------------------------- # Utility functions @@ -3442,7 +3443,17 @@ Defaulting color scheme to 'NoColor'""" Backend in use: Qt4Agg For more information, type 'help(pylab)'. """ - self.shell.enable_pylab(s) + + if Application.initialized(): + app = Application.instance() + try: + import_all_status = app.pylab_import_all + except AttributeError: + import_all_status = True + else: + import_all_status = True + + self.shell.enable_pylab(s,import_all=import_all_status) def magic_tb(self, s): """Print the last traceback with the currently active exception mode.