[Mpuls-commits] r2808 - in base/trunk: . mpulsweb/controllers mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri May 28 20:46:45 CEST 2010
Author: bh
Date: 2010-05-28 20:46:43 +0200 (Fri, 28 May 2010)
New Revision: 2808
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/controllers/evaluate.py
base/trunk/mpulsweb/lib/helpers.py
Log:
* mpulsweb/controllers/evaluate.py (get_phasesuccessors): New.
Moved here from helpers.
* mpulsweb/lib/helpers.py (get_phasesuccessors): Removed. It's
now in controllers/evaluate.py
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-05-28 14:18:13 UTC (rev 2807)
+++ base/trunk/ChangeLog 2010-05-28 18:46:43 UTC (rev 2808)
@@ -1,3 +1,11 @@
+2010-05-28 Bernhard Herzog <bh at intevation.de>
+
+ * mpulsweb/controllers/evaluate.py (get_phasesuccessors): New.
+ Moved here from helpers.
+
+ * mpulsweb/lib/helpers.py (get_phasesuccessors): Removed. It's
+ now in controllers/evaluate.py
+
2010-05-27 Bernhard Herzog <bh at intevation.de>
* mpulsweb/lib/helpers.py (tag): Moved here from renderer because
Modified: base/trunk/mpulsweb/controllers/evaluate.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluate.py 2010-05-28 14:18:13 UTC (rev 2807)
+++ base/trunk/mpulsweb/controllers/evaluate.py 2010-05-28 18:46:43 UTC (rev 2808)
@@ -49,6 +49,20 @@
log.debug('sdate: %s, edate: %s' % (sdate, edate))
return sdate, edate
+
+def get_phasesuccessors(p):
+ suc = []
+ phaselist = PhaseFactory().build()
+ for phase in phaselist:
+ if p == phase.id:
+ suc.append(phase.start.id)
+ suc.append(phase.end.id)
+ for ppid in phase.end.suc:
+ pp = phaselist.get_phase(ppid)
+ suc.extend(get_phasesuccessors(pp.phase))
+ return suc
+
+
def get_search_options(soptions=None, id=None):
options = {}
options['id'] = id
Modified: base/trunk/mpulsweb/lib/helpers.py
===================================================================
--- base/trunk/mpulsweb/lib/helpers.py 2010-05-28 14:18:13 UTC (rev 2807)
+++ base/trunk/mpulsweb/lib/helpers.py 2010-05-28 18:46:43 UTC (rev 2808)
@@ -51,7 +51,6 @@
from mpulsweb.lib.navigation import get_pagename, render_navigation
from mpulsweb.lib.helper.filters import shorten, nl_to_br, NA
-from mpulsweb.model.phase import PhaseFactory
PRINTABLE = frozenset(printable)
@@ -328,23 +327,4 @@
return empty
return dd_mm_YYYY(d) + " " + HH_MM(d)
-# Phases helpers. Used in evaluation
-
-# TODO: The functions are currently only used in lib.evaluation and are
-# basically a copy of those functions in model/phase_transition.py with the
-# difference that these function load phases from g.mpuls. The longterm
-# solution would be to transfer phase functionality into the libformed. So
-# these functions should be moved away from this place
-
-def get_phasesuccessors(p):
- suc = []
- phaselist = PhaseFactory().build()
- for phase in phaselist:
- if p == phase.id:
- suc.append(phase.start.id)
- suc.append(phase.end.id)
- for ppid in phase.end.suc:
- pp = phaselist.get_phase(ppid)
- suc.extend(get_phasesuccessors(pp.phase))
- return suc
# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
More information about the Mpuls-commits
mailing list