diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c7dfa31..e018a5e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 + +[v0.17.1] - 2025-09-17 +---------------------- + +Fixed +~~~~~ + +* wrong type checking inside `__init__` of `get_client`. Now initialize with GetCapabilities url + + [v0.17.0] - 2025-09-16 ---------------------- diff --git a/ows_lib/__init__.py b/ows_lib/__init__.py index d8b116e..cb42eec 100644 --- a/ows_lib/__init__.py +++ b/ows_lib/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.17.0" +__version__ = "0.17.1" VERSION = __version__ # synonym diff --git a/ows_lib/client/mixins.py b/ows_lib/client/mixins.py index 748ef6e..863ecf4 100644 --- a/ows_lib/client/mixins.py +++ b/ows_lib/client/mixins.py @@ -32,7 +32,7 @@ def __init__( if isinstance(capabilities, OGCServiceMixin): self.capabilities = capabilities - elif capabilities is str and "?" in capabilities: + elif isinstance(capabilities, str) and "?" in capabilities: # client was initialized with an url response = self.send_request( request=Request(method="GET", url=capabilities)) @@ -41,7 +41,9 @@ def __init__( else: raise InitialError( f"client could not be initialized by the given url: {capabilities}. Response status code: {response.status_code}") - + else: + raise TypeError("capabilities has to be GetCapabilities URL or parsed capabilites of type OGCServiceMixin") + def send_request(self, request: OGCRequest, timeout: int = 10) -> Response: """Sends a given request with internal session object.