sources: rename download -> fetch_all

Not all sources download things and `fetch_all` is consistent with
`fetch_one`.
This commit is contained in:
Simon de Vlieger 2024-01-23 11:50:52 +01:00 committed by Michael Vogt
parent 382ac8e960
commit f9b55ff6a0
6 changed files with 8 additions and 8 deletions

View file

@ -67,8 +67,8 @@ class SourceService(host.Service):
"""Performs the actual fetch of an element described by its checksum and its descriptor"""
@abc.abstractmethod
def download(self, items: Dict) -> None:
"""Download all sources."""
def fetch_all(self, items: Dict) -> None:
"""Fetch all sources."""
def exists(self, checksum, _desc) -> bool:
"""Returns True if the item to download is in cache. """
@ -94,7 +94,7 @@ class SourceService(host.Service):
if method == "download":
self.setup(args)
with tempfile.TemporaryDirectory(prefix=".unverified-", dir=self.cache) as self.tmpdir:
self.download(SourceService.load_items(fds))
self.fetch_all(SourceService.load_items(fds))
return None, None
raise host.ProtocolError("Unknown method")