diff options
Diffstat (limited to 'bitbake/lib/bb/progress.py')
-rw-r--r-- | bitbake/lib/bb/progress.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bitbake/lib/bb/progress.py b/bitbake/lib/bb/progress.py index 93e42dfcdb..49417761bb 100644 --- a/bitbake/lib/bb/progress.py +++ b/bitbake/lib/bb/progress.py | |||
@@ -195,3 +195,45 @@ class MultiStageProgressReporter(object): | |||
195 | else: | 195 | else: |
196 | out.append('Up to finish: %d' % stage_weight) | 196 | out.append('Up to finish: %d' % stage_weight) |
197 | bb.warn('Stage times:\n %s' % '\n '.join(out)) | 197 | bb.warn('Stage times:\n %s' % '\n '.join(out)) |
198 | |||
199 | class MultiStageProcessProgressReporter(MultiStageProgressReporter): | ||
200 | """ | ||
201 | Version of MultiStageProgressReporter intended for use with | ||
202 | standalone processes (such as preparing the runqueue) | ||
203 | """ | ||
204 | def __init__(self, d, processname, stage_weights, debug=False): | ||
205 | self._processname = processname | ||
206 | MultiStageProgressReporter.__init__(self, d, stage_weights, debug) | ||
207 | |||
208 | def start(self): | ||
209 | bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data) | ||
210 | |||
211 | def _fire_progress(self, taskprogress): | ||
212 | bb.event.fire(bb.event.ProcessProgress(self._processname, taskprogress), self._data) | ||
213 | |||
214 | def finish(self): | ||
215 | MultiStageProgressReporter.finish(self) | ||
216 | bb.event.fire(bb.event.ProcessFinished(self._processname), self._data) | ||
217 | |||
218 | class DummyMultiStageProcessProgressReporter(MultiStageProgressReporter): | ||
219 | """ | ||
220 | MultiStageProcessProgressReporter that takes the calls and does nothing | ||
221 | with them (to avoid a bunch of "if progress_reporter:" checks) | ||
222 | """ | ||
223 | def __init__(self): | ||
224 | MultiStageProcessProgressReporter.__init__(self, "", None, []) | ||
225 | |||
226 | def _fire_progress(self, taskprogress, rate=None): | ||
227 | pass | ||
228 | |||
229 | def start(self): | ||
230 | pass | ||
231 | |||
232 | def next_stage(self, stage_total=None): | ||
233 | pass | ||
234 | |||
235 | def update(self, stage_progress): | ||
236 | pass | ||
237 | |||
238 | def finish(self): | ||
239 | pass | ||