From fa61b56c69f524e2e7ca92fb8e2588838868a8dd Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 5 Jun 2024 01:07:36 +0200 Subject: webmap-download-mrr: Don't print request count on empty layers. We always exit after a single WMS request if the layer has no SVG paths. Don't print the request count in that case. --- webmap-download-mrr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webmap-download-mrr.py b/webmap-download-mrr.py index db3fda7..2c9d3b0 100644 --- a/webmap-download-mrr.py +++ b/webmap-download-mrr.py @@ -56,11 +56,12 @@ class WMS: self.version = version def __del__(self): - if self.req_count is not None and self.url is not None: - self.print_req_count() + self.print_req_count() def print_req_count(self, elapsed=None): - if elapsed is None: + if self.req_count is None or self.url is None: + return + 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, @@ -354,6 +355,7 @@ class WMS: probes.append( (poly0.MakeValid(), probe_count) ) if len(probes) == 0: + self.req_count = None # don't print request count return {}, crs features = {} -- cgit v1.2.3