summaryrefslogtreecommitdiff
path: root/src/buildstream/_project.py
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2019-07-03 11:06:01 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2019-07-26 13:18:57 +0100
commit638f213ed07d2209ff827a6710e5dea97d0b60f0 (patch)
tree3f65cadc444ea03ab9185b60a4d6b0957889df67 /src/buildstream/_project.py
parent737fbaca671140a1e1a6eb8bbcb01ed9bbc3fb21 (diff)
downloadbuildstream-638f213ed07d2209ff827a6710e5dea97d0b60f0.tar.gz
Render progress information for loading and processing elements
Diffstat (limited to 'src/buildstream/_project.py')
-rw-r--r--src/buildstream/_project.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index b14109630..f4a7466de 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -423,12 +423,18 @@ class Project():
# (list): A list of loaded Element
#
def load_elements(self, targets, *, rewritable=False):
- with self._context.messenger.timed_activity("Loading elements", silent_nested=True):
- meta_elements = self.loader.load(targets, rewritable=rewritable, ticker=None)
+ with self._context.messenger.simple_task("Loading elements", silent_nested=True) as task:
+ meta_elements = self.loader.load(targets, rewritable=rewritable, ticker=None, task=task)
- with self._context.messenger.timed_activity("Resolving elements"):
+ # workaround for task potentially being None (because no State object)
+ if task:
+ total_elements = task.current_progress
+
+ with self._context.messenger.simple_task("Resolving elements") as task:
+ if task:
+ task.set_maximum_progress(total_elements)
elements = [
- Element._new_from_meta(meta)
+ Element._new_from_meta(meta, task)
for meta in meta_elements
]