[Mpuls-commits] r4182 - in base/trunk: . mpulsweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Nov 15 20:33:29 CET 2010
Author: bh
Date: 2010-11-15 20:33:28 +0100 (Mon, 15 Nov 2010)
New Revision: 4182
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/model/phase.py
Log:
* mpulsweb/model/phase.py (get_phase_successors): Add optional
parameter phaselist so that the phaselist does not have to be
regenerated on every invocation.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-11-15 19:30:35 UTC (rev 4181)
+++ base/trunk/ChangeLog 2010-11-15 19:33:28 UTC (rev 4182)
@@ -1,5 +1,11 @@
2010-11-15 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/model/phase.py (get_phase_successors): Add optional
+ parameter phaselist so that the phaselist does not have to be
+ regenerated on every invocation.
+
+2010-11-15 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/model/phase.py (get_phasesuccessors)
(get_phase_successors): Rename to the more readable
get_phase_successors
Modified: base/trunk/mpulsweb/model/phase.py
===================================================================
--- base/trunk/mpulsweb/model/phase.py 2010-11-15 19:30:35 UTC (rev 4181)
+++ base/trunk/mpulsweb/model/phase.py 2010-11-15 19:33:28 UTC (rev 4182)
@@ -52,16 +52,17 @@
return result
-def get_phase_successors(p):
+def get_phase_successors(p, phaselist=None):
suc = []
- phaselist = PhaseFactory().build()
+ if phaselist is None:
+ 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_phase_successors(pp.phase))
+ suc.extend(get_phase_successors(pp.phase, phaselist))
return suc
More information about the Mpuls-commits
mailing list