summaryrefslogtreecommitdiffstats
path: root/lib/bb/progress.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-23 22:59:12 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-05 13:38:16 +0100
commit591e9741e108487ff437e77cb439ef2dbca42e03 (patch)
tree0cdb21be6b5c51e30a12cfbbea9fb931e5d57009 /lib/bb/progress.py
parent624722c067a7fdd0c0f5d8be611e1f6666ecc4a2 (diff)
downloadbitbake-contrib-591e9741e108487ff437e77cb439ef2dbca42e03.tar.gz
runqueue: report progress for "Preparing RunQueue" step
When "Preparing RunQueue" shows up you can expect to wait up to 30 seconds while it works - which is a bit long to leave the user waiting without any kind of output. Since the work being carried out during this time is divided into stages such that it's practical to determine internally how it's progressing, replace the message with a progress bar. Actually what happens during this time is two major steps rather than just one - the runqueue preparation itself, followed by the initialisation prior to running setscene tasks. I elected to have the progress bar cover both as one (there doesn't appear to be much point in doing otherwise from a user perspective). I did however describe it as "initialising tasks". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/progress.py')
-rw-r--r--lib/bb/progress.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/bb/progress.py b/lib/bb/progress.py
index 93e42dfcd..49417761b 100644
--- a/lib/bb/progress.py
+++ b/lib/bb/progress.py
@@ -195,3 +195,45 @@ class MultiStageProgressReporter(object):
else:
out.append('Up to finish: %d' % stage_weight)
bb.warn('Stage times:\n %s' % '\n '.join(out))
+
+class MultiStageProcessProgressReporter(MultiStageProgressReporter):
+ """
+ Version of MultiStageProgressReporter intended for use with
+ standalone processes (such as preparing the runqueue)
+ """
+ def __init__(self, d, processname, stage_weights, debug=False):
+ self._processname = processname
+ MultiStageProgressReporter.__init__(self, d, stage_weights, debug)
+
+ def start(self):
+ bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data)
+
+ def _fire_progress(self, taskprogress):
+ bb.event.fire(bb.event.ProcessProgress(self._processname, taskprogress), self._data)
+
+ def finish(self):
+ MultiStageProgressReporter.finish(self)
+ bb.event.fire(bb.event.ProcessFinished(self._processname), self._data)
+
+class DummyMultiStageProcessProgressReporter(MultiStageProgressReporter):
+ """
+ MultiStageProcessProgressReporter that takes the calls and does nothing
+ with them (to avoid a bunch of "if progress_reporter:" checks)
+ """
+ def __init__(self):
+ MultiStageProcessProgressReporter.__init__(self, "", None, [])
+
+ def _fire_progress(self, taskprogress, rate=None):
+ pass
+
+ def start(self):
+ pass
+
+ def next_stage(self, stage_total=None):
+ pass
+
+ def update(self, stage_progress):
+ pass
+
+ def finish(self):
+ pass