From 0bd103a46d201f7663c7ca091660d069b7e936c9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 14 Dec 2017 22:01:59 +0200 Subject: [PATCH] YAPF --- platformio/downloader.py | 6 +++--- platformio/telemetry.py | 5 +++-- tests/test_misc.py | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/platformio/downloader.py b/platformio/downloader.py index 7ecdbde6..737b21e4 100644 --- a/platformio/downloader.py +++ b/platformio/downloader.py @@ -71,18 +71,18 @@ class FileDownloader(object): return int(self._request.headers['content-length']) def start(self): + label = "Downloading" itercontent = self._request.iter_content(chunk_size=self.CHUNK_SIZE) f = open(self._destination, "wb") try: if app.is_disabled_progressbar() or self.get_size() == -1: - click.echo("Downloading...") + click.echo("%s..." % label) for chunk in itercontent: if chunk: f.write(chunk) else: chunks = int(ceil(self.get_size() / float(self.CHUNK_SIZE))) - with click.progressbar( - length=chunks, label="Downloading") as pb: + with click.progressbar(length=chunks, label=label) as pb: for _ in pb: f.write(next(itercontent)) except IOError as e: diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 75fa307f..c34f4039 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -315,8 +315,9 @@ def on_event(category, action, label=None, value=None, screen_name=None): def on_exception(e): skip_conditions = [ isinstance(e, cls) - for cls in (IOError, exception.AbortedByUser, - exception.NotGlobalLibDir, exception.InternetIsOffline, + for cls in (IOError, exception.ReturnErrorCode, + exception.AbortedByUser, exception.NotGlobalLibDir, + exception.InternetIsOffline, exception.NotPlatformIOProject, exception.UserSideException) ] diff --git a/tests/test_misc.py b/tests/test_misc.py index 271a4858..5d569b5b 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -13,9 +13,10 @@ # limitations under the License. import requests + from platformio import util def test_ping_internet_ips(): for ip in util.PING_INTERNET_IPS: - requests.get("http://%s" % ip, timeout=2) \ No newline at end of file + requests.get("http://%s" % ip, timeout=2)