Skip to content

Commit 21d3e2f

Browse files
authored
Merge pull request #32 from mrmap-community/feature/utility-get_client-with-get-cap-url
Update CHANGELOG.rst, __init__.py, and mixins.py
2 parents c1f5e41 + 592f94a commit 21d3e2f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99

1010

11+
12+
[v0.17.1] - 2025-09-17
13+
----------------------
14+
15+
Fixed
16+
~~~~~
17+
18+
* wrong type checking inside `__init__` of `get_client`. Now initialize with GetCapabilities url
19+
20+
1121
[v0.17.0] - 2025-09-16
1222
----------------------
1323

ows_lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.17.0"
1+
__version__ = "0.17.1"
22
VERSION = __version__ # synonym

ows_lib/client/mixins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232

3333
if isinstance(capabilities, OGCServiceMixin):
3434
self.capabilities = capabilities
35-
elif capabilities is str and "?" in capabilities:
35+
elif isinstance(capabilities, str) and "?" in capabilities:
3636
# client was initialized with an url
3737
response = self.send_request(
3838
request=Request(method="GET", url=capabilities))
@@ -41,7 +41,9 @@ def __init__(
4141
else:
4242
raise InitialError(
4343
f"client could not be initialized by the given url: {capabilities}. Response status code: {response.status_code}")
44-
44+
else:
45+
raise TypeError("capabilities has to be GetCapabilities URL or parsed capabilites of type OGCServiceMixin")
46+
4547
def send_request(self, request: OGCRequest, timeout: int = 10) -> Response:
4648
"""Sends a given request with internal session object.
4749

0 commit comments

Comments
 (0)