diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-07-12 16:14:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-11 00:08:17 +0100 |
commit | 5529bcd860d2932b967a064ae28690ac5a725342 (patch) | |
tree | 1e21f4c54146ed1fc90850e1dda47aac25fecbe3 /lib/toaster/orm | |
parent | f33d51d46d70e73e04e325807c1bc4eb68462f7b (diff) | |
download | bitbake-contrib-5529bcd860d2932b967a064ae28690ac5a725342.tar.gz |
toaster: show "Tasks starting..." until the first task completes
To prevent showing a "0% of tasks complete" message for a long time,
don't show the progress bar until the first task has finished.
While waiting for that first task, show a message about tasks
starting instead.
[YOCTO #9631]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Diffstat (limited to 'lib/toaster/orm')
-rw-r--r-- | lib/toaster/orm/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py index 4641736ad..cfa243c59 100644 --- a/lib/toaster/orm/models.py +++ b/lib/toaster/orm/models.py @@ -628,6 +628,17 @@ class Build(models.Model): return self.outcome == Build.IN_PROGRESS and \ self.recipes_parsed < self.recipes_to_parse + def is_starting(self): + """ + True if the build has no completed tasks yet and is still just starting + tasks. + + Note that the mechanism for testing whether a Task is "done" is whether + its order field is set, as per the completeper() method. + """ + return self.outcome == Build.IN_PROGRESS and \ + self.task_build.filter(order__isnull=False).count() == 0 + def get_state(self): """ Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress', @@ -643,6 +654,8 @@ class Build(models.Model): return 'Queued' elif self.is_parsing(): return 'Parsing' + elif self.is_starting(): + return 'Starting' else: return self.get_outcome_text() |