summaryrefslogtreecommitdiff
path: root/src/buildstream/_stream.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/_stream.py')
-rw-r--r--src/buildstream/_stream.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 58d4a0ebd..269cbb542 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -613,6 +613,28 @@ class Stream():
with tarfile.open(location, mode=mode) as tf:
virdir.export_to_tar(tf, '.')
+ # artifact_show()
+ #
+ # Show cached artifacts
+ #
+ # Args:
+ # targets (str): Targets to show the cached state of
+ #
+ def artifact_show(self, targets, *,
+ selection=PipelineSelection.NONE):
+ # Obtain list of Element and/or ArtifactElement objects
+ target_objects = self.load_selection(targets,
+ selection=selection,
+ load_refs=True)
+
+ # XXX: We need to set the name of an ArtifactElement to its ref in order
+ # to display the expected result in the frontend
+ for obj in target_objects:
+ if isinstance(obj, ArtifactElement):
+ obj.name = obj.get_artifact_name()
+
+ return target_objects
+
# artifact_log()
#
# Show the full log of an artifact