diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-04-25 17:36:35 +0100 |
---|---|---|
committer | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-04-26 11:00:39 +0100 |
commit | 222776d6ec4c1b350e0c43bfa8c678d88aa9af02 (patch) | |
tree | b83a719ccd04843796b49b4697568d7f2f0a68b9 | |
parent | ee5636cd1f99a1df2e7b68efa3d7ffa2e560b512 (diff) | |
download | buildstream-222776d6ec4c1b350e0c43bfa8c678d88aa9af02.tar.gz |
_artifact.py: Remove the returned key from the get_$subdir methods
As with the metadata simplification, the key is internalised to the
element's Artifact member as such it is redudant to return the key
which was used.
-rw-r--r-- | buildstream/_artifact.py | 12 | ||||
-rw-r--r-- | buildstream/element.py | 6 |
2 files changed, 7 insertions, 11 deletions
diff --git a/buildstream/_artifact.py b/buildstream/_artifact.py index 81b9f3642..d2fdd0f34 100644 --- a/buildstream/_artifact.py +++ b/buildstream/_artifact.py @@ -67,12 +67,10 @@ class Artifact(): # # Returns: # (Directory): The virtual directory object - # (str): The chosen key # def get_files(self): - subdir = "files" - - return self._get_subdirectory(subdir) + files, _ = self._get_subdirectory("files") + return files # get_buildtree(): # @@ -80,12 +78,10 @@ class Artifact(): # # Returns: # (Directory): The virtual directory object - # (str): The chosen key # def get_buildtree(self): - subdir = "buildtree" - - return self._get_subdirectory(subdir) + buildtree, _ = self._get_subdirectory("buildtree") + return buildtree # get_extract_key(): # diff --git a/buildstream/element.py b/buildstream/element.py index 95081b940..05884c008 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -675,7 +675,7 @@ class Element(Plugin): self.__assert_cached() with self.timed_activity("Staging {}/{}".format(self.name, self._get_brief_display_key())): - files_vdir, _ = self.__artifact.get_files() + files_vdir = self.__artifact.get_files() # Hard link it into the staging area # @@ -1525,7 +1525,7 @@ class Element(Plugin): # Check if we have a cached buildtree to use elif usebuildtree: - import_dir, _ = self.__artifact.get_buildtree() + import_dir = self.__artifact.get_buildtree() if import_dir.is_empty(): detail = "Element type either does not expect a buildtree or it was explictily cached without one." self.warn("WARNING: {} Artifact contains an empty buildtree".format(self.name), detail=detail) @@ -2774,7 +2774,7 @@ class Element(Plugin): def __compute_splits(self, include=None, exclude=None, orphans=True): filter_func = self.__split_filter_func(include=include, exclude=exclude, orphans=orphans) - files_vdir, _ = self.__artifact.get_files() + files_vdir = self.__artifact.get_files() element_files = files_vdir.list_relative_paths() |