From 7de8d3ae12486c5ea06557414047e7e37a2a391a Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 8 Jun 2024 00:12:43 +0200 Subject: webmap-download*: Use narrow non-breaking space (U+202F) as unit separator. --- common.py | 8 ++++---- webmap-download-mrr.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common.py b/common.py index b8913de..b46840f 100644 --- a/common.py +++ b/common.py @@ -139,13 +139,13 @@ def load_config(path=None, groupnames=None): def format_bytes(n): if n < 768: - return f'{n}B' + return f'{n}\u202FB' elif n < 768*1024: - return f'{n/1024:.2f}kiB' + return f'{n/1024:.2f}\u202FkiB' elif n < 768*1024*1024: - return f'{n/1048576:.2f}MiB' + return f'{n/1048576:.2f}\u202FMiB' else: - return f'{n/1073741824:.2f}GiB' + return f'{n/1073741824:.2f}\u202FGiB' def format_time(s): fs, s = modf(s) diff --git a/webmap-download-mrr.py b/webmap-download-mrr.py index cfa1432..2477f8a 100644 --- a/webmap-download-mrr.py +++ b/webmap-download-mrr.py @@ -64,7 +64,7 @@ class WMS: elif elapsed is None: logging.info('%d WMS requests sent to %s', self.req_count, self.url) else: - logging.info('%d WMS requests (%.2f req/s) sent to %s', self.req_count, + logging.info('%d WMS requests (%.2f\u202Freq/s) sent to %s', self.req_count, self.req_count/elapsed, self.url) # Send a request to the WMS server @@ -662,7 +662,7 @@ def download(dl, dest, dir_fd=None, headers={}, session=requests, progress=None) elapsed = time_monotonic() - start wms.print_req_count(elapsed=elapsed) wms.req_count = None - logging.info('%s: Fetched %d features (%s) in %s (%.2f feat/s, %s/s)', dest, + logging.info('%s: Fetched %d features (%s) in %s (%.2f\u202Ffeat/s, %s/s)', dest, feature_count, common.format_bytes(size), common.format_time(elapsed), feature_count/elapsed, -- cgit v1.2.3