You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:25:21 UTC

[buildstream] 11/13: Remove unused progress callback

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch tpollard/prototemp
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 8f8e8b8f208c3afa5d6b2654fdb265a23b39a698
Author: Raoul Hidalgo Charman <ra...@codethink.co.uk>
AuthorDate: Mon Apr 15 11:15:29 2019 +0100

    Remove unused progress callback
---
 buildstream/_artifactcache.py |  3 +--
 buildstream/_cas/cascache.py  |  5 +----
 buildstream/_sourcecache.py   |  4 ++--
 buildstream/element.py        | 17 ++++++-----------
 4 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py
index 2fc3dcf..5df3804 100644
--- a/buildstream/_artifactcache.py
+++ b/buildstream/_artifactcache.py
@@ -324,13 +324,12 @@ class ArtifactCache(BaseCache):
     # Args:
     #     element (Element): The Element whose artifact is to be fetched
     #     key (str): The cache key to use
-    #     progress (callable): The progress callback, if any
     #     pull_buildtrees (bool): Whether to pull buildtrees or not
     #
     # Returns:
     #   (bool): True if pull was successful, False if artifact was not available
     #
-    def pull(self, element, key, *, progress=None, pull_buildtrees=False):
+    def pull(self, element, key, *, pull_buildtrees=False):
         project = element._get_project()
 
         for remote in self._remotes[project]:
diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py
index 5c1642d..85f4c7e 100644
--- a/buildstream/_cas/cascache.py
+++ b/buildstream/_cas/cascache.py
@@ -250,14 +250,11 @@ class CASCache():
     # Args:
     #     ref (str): The ref to pull
     #     remote (CASRemote): The remote repository to pull from
-    #     progress (callable): The progress callback, if any
-    #     subdir (str): The optional specific subdir to pull
-    #     excluded_subdirs (list): The optional list of subdirs to not pull
     #
     # Returns:
     #   (bool): True if pull was successful, False if ref was not available
     #
-    def pull(self, ref, remote, *, progress=None):
+    def pull(self, ref, remote):
         try:
             remote.init()
 
diff --git a/buildstream/_sourcecache.py b/buildstream/_sourcecache.py
index 8dfa975..0c2ae3b 100644
--- a/buildstream/_sourcecache.py
+++ b/buildstream/_sourcecache.py
@@ -185,7 +185,7 @@ class SourceCache(BaseCache):
     #
     # Returns:
     #    (bool): True if pull successful, False if not
-    def pull(self, source, *, progress=None):
+    def pull(self, source):
         ref = source._get_source_name()
 
         project = source._get_project()
@@ -196,7 +196,7 @@ class SourceCache(BaseCache):
             try:
                 source.status("Pulling source {} <- {}".format(display_key, remote.spec.url))
 
-                if self.cas.pull(ref, remote, progress=progress):
+                if self.cas.pull(ref, remote):
                     source.info("Pulled source {} <- {}".format(display_key, remote.spec.url))
                     # no need to pull from additional remotes
                     return True
diff --git a/buildstream/element.py b/buildstream/element.py
index 4cf8d89..ba8e93d 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1890,18 +1890,15 @@ class Element(Plugin):
     def _pull(self):
         context = self._get_context()
 
-        def progress(percent, message):
-            self.status(message)
-
         # Get optional specific subdir to pull and optional list to not pull
         # based off of user context
         pull_buildtrees = context.pull_buildtrees
 
         # Attempt to pull artifact without knowing whether it's available
-        pulled = self.__pull_strong(progress=progress, pull_buildtrees=pull_buildtrees)
+        pulled = self.__pull_strong(pull_buildtrees=pull_buildtrees)
 
         if not pulled and not self._cached() and not context.get_strict():
-            pulled = self.__pull_weak(progress=progress, pull_buildtrees=pull_buildtrees)
+            pulled = self.__pull_weak(pull_buildtrees=pull_buildtrees)
 
         if not pulled:
             return False
@@ -2840,11 +2837,10 @@ class Element(Plugin):
     # Returns:
     #     (bool): Whether or not the pull was successful
     #
-    def __pull_strong(self, *, progress=None, pull_buildtrees):
+    def __pull_strong(self, *, pull_buildtrees):
         weak_key = self._get_cache_key(strength=_KeyStrength.WEAK)
         key = self.__strict_cache_key
-        if not self.__artifacts.pull(self, key, progress=progress,
-                                     pull_buildtrees=pull_buildtrees):
+        if not self.__artifacts.pull(self, key, pull_buildtrees=pull_buildtrees):
             return False
 
         # update weak ref by pointing it to this newly fetched artifact
@@ -2858,16 +2854,15 @@ class Element(Plugin):
     # the weak cache key
     #
     # Args:
-    #     progress (callable): The progress callback, if any
     #     subdir (str): The optional specific subdir to pull
     #     excluded_subdirs (list): The optional list of subdirs to not pull
     #
     # Returns:
     #     (bool): Whether or not the pull was successful
     #
-    def __pull_weak(self, *, progress=None, pull_buildtrees):
+    def __pull_weak(self, *, pull_buildtrees):
         weak_key = self._get_cache_key(strength=_KeyStrength.WEAK)
-        if not self.__artifacts.pull(self, weak_key, progress=progress,
+        if not self.__artifacts.pull(self, weak_key,
                                      pull_buildtrees=pull_buildtrees):
             return False