summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-14 12:40:21 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-08-27 12:12:13 +0100
commitab94b695a54de53593c771626f71f62a912fae3b (patch)
tree3f78b2687aafab38f75d0cc13f72325a89d97e4e
parenta6d252963a53da0395379927aa06eb3e0f3c9741 (diff)
downloadbuildstream-ab94b695a54de53593c771626f71f62a912fae3b.tar.gz
element.py: Add _get_artifact() method
Add a getter for Element's __artifact (Artifact object). This is required by ArtifactElement. The ArtifactElement should have access to its Artifact.
-rw-r--r--src/buildstream/element.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index bd5ca14e7..78fee5dff 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -2355,6 +2355,17 @@ class Element(Plugin):
casbd = self.__artifact.get_files()
return [f for f in casbd.list_relative_paths()]
+ # _get_artifact()
+ #
+ # Return the Element's Artifact object
+ #
+ # Returns:
+ # (Artifact): The Artifact object of the Element
+ #
+ def _get_artifact(self):
+ assert self.__artifact, "{}: has no Artifact object".format(self.name)
+ return self.__artifact
+
#############################################################
# Private Local Methods #
#############################################################