[Mpuls-commits] r6091 - base/trunk/mpulsweb/controllers

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 4 14:32:53 CEST 2012


Author: torsten
Date: 2012-10-04 14:32:52 +0200 (Thu, 04 Oct 2012)
New Revision: 6091

Modified:
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
Try to load the evaluation config from a external directory first which can be
configured in the ini file. If this fails load config from public/xml


Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2012-10-03 12:22:18 UTC (rev 6090)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2012-10-04 12:32:52 UTC (rev 6091)
@@ -25,10 +25,15 @@
     for enabled_eval in g.mpuls_config.get('evaluations', 'enabled'):
         if enabled_eval.get('id') == str(id):
             filename = enabled_eval.get('config')
-            for d in pylons.config.get('pylons.paths').get('static_files'):
-                path = os.path.join(d, 'xml', filename)
-                if os.path.exists(path):
-                    return path
+            eval_dir = pylons.config.get('mpuls.app.path.evaluation')
+            path = os.path.join(eval_dir, filename)
+            if os.path.exists(path):
+                return path
+            else:
+                for d in pylons.config.get('pylons.paths').get('static_files'):
+                    path = os.path.join(d, 'xml', filename)
+                    if os.path.exists(path):
+                        return path
     return None
 
 def get_phase_dates(id):



More information about the Mpuls-commits mailing list