From ab94b695a54de53593c771626f71f62a912fae3b Mon Sep 17 00:00:00 2001 From: James Ennis Date: Wed, 14 Aug 2019 12:40:21 +0100 Subject: 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. --- src/buildstream/element.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 # ############################################################# -- cgit v1.2.1