[Mpuls-commits] r4993 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 24 12:56:28 CEST 2011


Author: bh
Date: 2011-05-24 12:56:27 +0200 (Tue, 24 May 2011)
New Revision: 4993

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/evaluate.py
Log:
* mpulsweb/controllers/evaluate.py (get_common_options): Pass
evalconfig as a parameter instead of relying on it being in the c
object. This makes the dependency clearer.
(EvaluateController.evaluate): Adapt to get_common_options change.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-05-24 10:54:25 UTC (rev 4992)
+++ base/trunk/ChangeLog	2011-05-24 10:56:27 UTC (rev 4993)
@@ -1,5 +1,12 @@
 2011-05-24  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/controllers/evaluate.py (get_common_options): Pass
+	evalconfig as a parameter instead of relying on it being in the c
+	object. This makes the dependency clearer.
+	(EvaluateController.evaluate): Adapt to get_common_options change.
+
+2011-05-24  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/controllers/evaluate.py (get_search_options)
 	(get_default_options, get_common_options, get_session_options):
 	Split get_search_options into the separate new functions

Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py	2011-05-24 10:54:25 UTC (rev 4992)
+++ base/trunk/mpulsweb/controllers/evaluate.py	2011-05-24 10:56:27 UTC (rev 4993)
@@ -57,7 +57,7 @@
                 end_date=g.mpuls_config.get_date('search', 'default-end-date'))
 
 
-def get_common_options(id, selected_ids):
+def get_common_options(evalconfig, id, selected_ids):
     """Return a dictionary with common evaluation options.
 
     The parameter id should be the id of the evaluation. It will be
@@ -71,7 +71,7 @@
     it should be an empty sequence.
     """
     return dict(id=id, selected_ids=selected_ids,
-                typelist=c.evalconfig.get_evaluations())
+                typelist=evalconfig.get_evaluations())
 
 
 def get_session_options():
@@ -106,8 +106,8 @@
         c.evalconfig = EvaluationConfig(get_configfile(id), None, None, None,
                                         None, None, None, None, None)
         evaloptions = get_default_options()
-        evaloptions.update(get_common_options(id, session.get("evaluation_ids",
-                                                              ())))
+        evaloptions.update(get_common_options(c.evalconfig, id,
+                                              session.get("evaluation_ids",())))
         evaloptions.update(get_session_options())
 
         # If user selects adele-evaluation render page with disabled



More information about the Mpuls-commits mailing list