From 7e41841a74917cc49e147e9fea965ea6bf51151a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 11 Jan 2020 15:23:36 +0200 Subject: [PATCH] Allow to call Downloader API in silent mode --- platformio/downloader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio/downloader.py b/platformio/downloader.py index 57c712ed..0a9b981f 100644 --- a/platformio/downloader.py +++ b/platformio/downloader.py @@ -74,13 +74,14 @@ class FileDownloader(object): return -1 return int(self._request.headers["content-length"]) - def start(self, with_progress=True): + def start(self, with_progress=True, silent=False): label = "Downloading" itercontent = self._request.iter_content(chunk_size=self.CHUNK_SIZE) f = open(self._destination, "wb") try: if not with_progress or self.get_size() == -1: - click.echo("%s..." % label) + if not silent: + click.echo("%s..." % label) for chunk in itercontent: if chunk: f.write(chunk)