aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-06-08 00:12:43 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-06-08 00:12:43 +0200
commit7de8d3ae12486c5ea06557414047e7e37a2a391a (patch)
treeb3c0cf592e4ae4c23a5cc12c0cfb1235cb7a4eaa
parenta7fd696267b81377ab69b1bcbcc6581fa5fe5a0d (diff)
webmap-download*: Use narrow non-breaking space (U+202F) as unit separator.
-rw-r--r--common.py8
-rw-r--r--webmap-download-mrr.py4
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,