From 86de13f96cff6d6aeab7d2f76a06e3df4a30cb6c 2011-03-25 06:04:30 From: MinRK Date: 2011-03-25 06:04:30 Subject: [PATCH] add 'osx' to known pylab backends, fix pylab mode with MacOSX backend closes gh-202 --- diff --git a/IPython/core/magic.py b/IPython/core/magic.py index bfe2342..3e8d117 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -3371,7 +3371,7 @@ Defaulting color scheme to 'NoColor'""" Parameters ---------- guiname : optional - One of the valid arguments to the %gui magic ('qt', 'wx', 'gtk' or + One of the valid arguments to the %gui magic ('qt', 'wx', 'gtk', 'osx' or 'tk'). If given, the corresponding Matplotlib backend is used, otherwise matplotlib's default (which you can override in your matplotlib config file) is used. diff --git a/IPython/lib/inputhook.py b/IPython/lib/inputhook.py index 4f3bbee..bb619cb 100755 --- a/IPython/lib/inputhook.py +++ b/IPython/lib/inputhook.py @@ -28,6 +28,7 @@ GUI_QT = 'qt' GUI_QT4 = 'qt4' GUI_GTK = 'gtk' GUI_TK = 'tk' +GUI_OSX = 'osx' #----------------------------------------------------------------------------- # Utility classes @@ -310,6 +311,7 @@ def enable_gui(gui=None): one. """ guis = {None: clear_inputhook, + GUI_OSX: lambda app=False: None, GUI_TK: enable_tk, GUI_GTK: enable_gtk, GUI_WX: enable_wx, diff --git a/IPython/lib/pylabtools.py b/IPython/lib/pylabtools.py index 954afc6..071b8b8 100644 --- a/IPython/lib/pylabtools.py +++ b/IPython/lib/pylabtools.py @@ -30,6 +30,7 @@ backends = {'tk': 'TkAgg', 'wx': 'WXAgg', 'qt': 'Qt4Agg', # qt3 not supported 'qt4': 'Qt4Agg', + 'osx': 'MacOSX', 'inline' : 'module://IPython.zmq.pylab.backend_inline'} #-----------------------------------------------------------------------------