diff --git a/pygeoapi/provider/speckle.py b/pygeoapi/provider/speckle.py index 67d3895..212b91e 100644 --- a/pygeoapi/provider/speckle.py +++ b/pygeoapi/provider/speckle.py @@ -136,6 +136,7 @@ class SpeckleProvider(BaseProvider): self.north_degrees: float = 0 self.crs_authid = "" self.limit = 10000 + self.user_agent = "" self.missing_url = "" self.limit_message = "" @@ -385,6 +386,7 @@ class SpeckleProvider(BaseProvider): raise SpeckleException("Transport not found") # receive commit + set_actions(self, client) try: commit_obj = operations.receive(objId, transport, None) except Exception as ex: @@ -399,7 +401,6 @@ class SpeckleProvider(BaseProvider): ) print(f"____{datetime.now().astimezone(timezone.utc)} _Rendering model '{branch['name']}' of the project '{stream['name']}'") - set_actions(self, client) speckle_data = self.traverse_data(commit_obj, comments) speckle_data["features"].extend(speckle_data["comments"]) diff --git a/pygeoapi/provider/speckle_utils/server_utils.py b/pygeoapi/provider/speckle_utils/server_utils.py index 817e4dc..87d3f6e 100644 --- a/pygeoapi/provider/speckle_utils/server_utils.py +++ b/pygeoapi/provider/speckle_utils/server_utils.py @@ -224,6 +224,7 @@ def set_actions(self: "SpeckleProvider", client: "SpeckleClient"): full_dict["GIS commit"] = self.commit_gis full_dict["model"] = f"{self.project_name}, {self.model_name}" full_dict["time_TOTAL"] = sum([x[1] for x in self.times.items()]) + full_dict["model_url"] = self.speckle_url track("GEO receive", client.account, full_dict) except: pass \ No newline at end of file diff --git a/pygeoapi/provider/speckle_utils/url_utils.py b/pygeoapi/provider/speckle_utils/url_utils.py index 25a017e..a8727cc 100644 --- a/pygeoapi/provider/speckle_utils/url_utils.py +++ b/pygeoapi/provider/speckle_utils/url_utils.py @@ -80,6 +80,14 @@ def get_set_url_parameters(self: "SpeckleProvider"): self.url_params["url_limit"] = limit except: ValueError(f"Invalid limit input, must be a positive integer: {item}") + + elif "useragent=" in item: + try: + agent = item.split("useragent=")[1] + self.user_agent = agent + self.url_params["user_agent"] = agent + except: + ValueError(f"Invalid limit input, must be a positive integer: {item}") if self.speckle_url == "-":