[Yt-svn] yt-commit r1721 - trunk/scripts

joishi at wrangler.dreamhost.com joishi at wrangler.dreamhost.com
Tue May 18 15:38:40 PDT 2010


Author: joishi
Date: Tue May 18 15:38:40 2010
New Revision: 1721
URL: http://yt.enzotools.org/changeset/1721

Log:
corrected ipython shell selection for general threaded case. this should be sensitive to what the user has in matplotlibrc.


Modified:
   trunk/scripts/iyt

Modified: trunk/scripts/iyt
==============================================================================
--- trunk/scripts/iyt	(original)
+++ trunk/scripts/iyt	Tue May 18 15:38:40 2010
@@ -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