83 |
# |
# |
84 |
# phaseInit |
# phaseInit |
85 |
# |
# |
86 |
def phaseInit(self, iterations=5): |
def phaseInit(self, iterations=5, params={}): |
87 |
for phase in range(iterations): |
for phase in range(iterations): |
88 |
self._phaseInit(phase) |
self._phaseInit(phase, params) |
89 |
|
|
90 |
def _phaseInit(self,phase): |
def _phaseInit(self,phase,params): |
91 |
if (len(self._inits) > phase) and self._inits[phase]: |
if (len(self._inits) > phase) and self._inits[phase]: |
92 |
GDebug.printMesg(6,"%s: Init Phase %s" % (self._type, phase+1)) |
GDebug.printMesg(6,"%s: Init Phase %s" % (self._type, phase+1)) |
93 |
self._inits[phase]() |
if self._type=='GFForm': |
94 |
|
self._inits[phase](params) |
95 |
|
else: |
96 |
|
self._inits[phase]() |
97 |
|
|
98 |
for child in self._children: |
for child in self._children: |
99 |
if isinstance(child, GObj): |
if isinstance(child, GObj): |
100 |
child._phaseInit(phase) |
child._phaseInit(phase,params) |
101 |
|
|
102 |
# This function is called after the parsers have completely |
# This function is called after the parsers have completely |
103 |
# constructed. All children should be in place and |
# constructed. All children should be in place and |