aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-06-05 01:07:36 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-06-05 01:08:53 +0200
commitfa61b56c69f524e2e7ca92fb8e2588838868a8dd (patch)
tree4e275eb928ca13c21ed4236497285e1848715747
parent94263348e820eca8772fa7ef891a3df5944db651 (diff)
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.
-rw-r--r--webmap-download-mrr.py8
1 files 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 = {}