diff options
author | Tristan van Berkom <tristan@codethink.co.uk> | 2020-09-11 13:10:57 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan@codethink.co.uk> | 2020-09-18 12:38:49 +0900 |
commit | af478ca1b9a2855b0b0bcd71d4e33270853caade (patch) | |
tree | ed46ef4613bc6c7596696c6cac638a1c9f64e11f | |
parent | 7912ea10e6d47344dedbb1f15cd51a63ebe6824b (diff) | |
download | buildstream-af478ca1b9a2855b0b0bcd71d4e33270853caade.tar.gz |
_loader/loadelement.pyx: Added `path` property
This helps simplify the following Element.configure_dependencies()
implementing patch.
-rw-r--r-- | src/buildstream/_loader/loadelement.pyx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buildstream/_loader/loadelement.pyx b/src/buildstream/_loader/loadelement.pyx index c7d6ec88d..858334c7d 100644 --- a/src/buildstream/_loader/loadelement.pyx +++ b/src/buildstream/_loader/loadelement.pyx @@ -92,6 +92,17 @@ cdef class Dependency: def provenance(self): return self._node.get_provenance() + # path + # + # The path of the dependency represented as a single string, + # instead of junction and name being separate. + # + @property + def path(self): + if self.junction is not None: + return "{}:{}".format(self.junction, self.name) + return self.name + # set_element() # # Sets the resolved LoadElement |