[Yt-svn] yt: corrected ipython shell selection for general threaded case....

hg at spacepope.org hg at spacepope.org
Tue May 18 15:26:32 PDT 2010


hg Repository: yt
details:   yt/rev/256be9be0a41
changeset: 1680:256be9be0a41
user:      J.S. Oishi <jsoishi at gmail.com>
date:
Tue May 18 15:26:16 2010 -0700
description:
corrected ipython shell selection for general threaded case. this should be sensitive to what the user has in matplotlibrc.

diffstat:

 scripts/iyt |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 04be832f6138 -r 256be9be0a41 scripts/iyt
--- a/scripts/iyt	Tue May 18 09:21:08 2010 -0700
+++ b/scripts/iyt	Tue May 18 15:26:16 2010 -0700
@@ -19,9 +19,16 @@
     sys.exit()
 
 if "DISPLAY" in os.environ:
+    from matplotlib import rcParams
+    ipbackends = dict(Qt4 = IPython.Shell.IPShellMatplotlibQt4,
+                      WX  = IPython.Shell.IPShellMatplotlibWX,
+                      GTK = IPython.Shell.IPShellMatplotlibGTK,
+                      Qt  = IPython.Shell.IPShellMatplotlibQt)
+    bend = (rcParams["backend"]).rstrip('Agg')
+    
     try:
-        ip_shell = IPython.Shell.IPShellMatplotlibWX(user_ns=namespace)
-    except ImportError:
+        ip_shell = ipbackends[bend](user_ns=namespace)
+    except KeyError:
         ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace)
 else:
     ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace)



More information about the yt-svn mailing list