[Yt-svn] yt-commit r1484 - in branches/yt-1.5: . yt/lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Oct 15 17:48:19 PDT 2009


Author: mturk
Date: Thu Oct 15 17:48:18 2009
New Revision: 1484
URL: http://yt.enzotools.org/changeset/1484

Log:
Fixing a bug with the field plugins; it now won't try if it can't find the
file.



Removed:
   branches/yt-1.5/freezer.py
Modified:
   branches/yt-1.5/yt/lagos/__init__.py

Modified: branches/yt-1.5/yt/lagos/__init__.py
==============================================================================
--- branches/yt-1.5/yt/lagos/__init__.py	(original)
+++ branches/yt-1.5/yt/lagos/__init__.py	Thu Oct 15 17:48:18 2009
@@ -38,6 +38,8 @@
 import warnings
 try:
     import h5py
+    if not hasattr(h5py.h5, "ArgsError"):
+        h5py.h5.ArgsError = h5py.h5.H5Error
 except ImportError:
     ytcfg["lagos", "serialize"] = "False"
     mylog.warning("No h5py. Data serialization disabled.")
@@ -102,6 +104,9 @@
 if ytcfg.getboolean("lagos","loadfieldplugins"):
     my_plugin_name = ytcfg.get("lagos","pluginfilename")
     # We assume that it is with respect to the $HOME/.yt directory
-    execfile(os.path.expanduser("~/.yt/%s" % my_plugin_name))
+    fn = os.path.expanduser("~/.yt/%s" % my_plugin_name)
+    if os.path.isfile(fn):
+        mylog.info("Loading plugins from %s", fn)
+        execfile(fn)
 
 log_fields = [] # @todo: GET RID OF THIS



More information about the yt-svn mailing list