[Yt-svn] yt-commit r1453 - in trunk/yt: . lagos

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Thu Sep 17 10:33:17 PDT 2009


Author: mturk
Date: Thu Sep 17 10:33:15 2009
New Revision: 1453
URL: http://yt.spacepope.org/changeset/1453

Log:
New default behvaior: loading of field plugins is on by default, and it will
only do so if the file exists.  Furthermore, this information will be reported
to the user at the 'info' level.



Modified:
   trunk/yt/config.py
   trunk/yt/lagos/__init__.py

Modified: trunk/yt/config.py
==============================================================================
--- trunk/yt/config.py	(original)
+++ trunk/yt/config.py	Thu Sep 17 10:33:15 2009
@@ -47,8 +47,8 @@
         'ReconstructHierarchy': 'True',
         'serialize' : 'True',
         'onlydeserialize' : 'False',
-        'loadfieldplugins':'False',
-        'pluginfilename':'yt_plugins.py',
+        'loadfieldplugins':'True',
+        'pluginfilename':'my_plugins.py',
         },
     "yt":{
         'time_functions': 'False',

Modified: trunk/yt/lagos/__init__.py
==============================================================================
--- trunk/yt/lagos/__init__.py	(original)
+++ trunk/yt/lagos/__init__.py	Thu Sep 17 10:33:15 2009
@@ -104,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