[Yt-svn] yt-commit r1328 - branches/yt-1.5/scripts trunk/scripts

joishi at wrangler.dreamhost.com joishi at wrangler.dreamhost.com
Tue Jun 9 11:43:53 PDT 2009


Author: joishi
Date: Tue Jun  9 11:43:52 2009
New Revision: 1328
URL: http://yt.spacepope.org/changeset/1328

Log:
added import os
made yt-1.5 version of iyt script the same as trunk


Modified:
   branches/yt-1.5/scripts/iyt
   trunk/scripts/iyt

Modified: branches/yt-1.5/scripts/iyt
==============================================================================
--- branches/yt-1.5/scripts/iyt	(original)
+++ branches/yt-1.5/scripts/iyt	Tue Jun  9 11:43:52 2009
@@ -1,5 +1,5 @@
 #!python
-
+import os
 from yt.mods import *
 namespace = locals().copy()
 
@@ -18,9 +18,12 @@
     code.interact(doc, None, namespace)
     sys.exit()
 
-try:
-    ip_shell = IPython.Shell.IPShellMatplotlibWX(user_ns=namespace)
-except ImportError:
+if "DISPLAY" in os.environ:
+    try:
+        ip_shell = IPython.Shell.IPShellMatplotlibWX(user_ns=namespace)
+    except ImportError:
+        ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace)
+else:
     ip_shell = IPython.Shell.IPShellMatplotlib(user_ns=namespace)
 
 # The rest is a modified version of the IPython default profile code

Modified: trunk/scripts/iyt
==============================================================================
--- trunk/scripts/iyt	(original)
+++ trunk/scripts/iyt	Tue Jun  9 11:43:52 2009
@@ -1,5 +1,5 @@
 #!python
-
+import os
 from yt.mods import *
 namespace = locals().copy()
 



More information about the yt-svn mailing list