simple-dwd-weatherforecast 3.0.0__py3-none-any.whl → 3.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simple_dwd_weatherforecast/dwdmap.py +15 -6
- {simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/METADATA +1 -1
- {simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/RECORD +6 -6
- {simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/WHEEL +0 -0
- {simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/licenses/LICENCE +0 -0
- {simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/top_level.txt +0 -0
@@ -181,13 +181,18 @@ def get_map(
|
|
181
181
|
# Combine layers with special layers first, then map types, then other layers
|
182
182
|
layers = f"{','.join(special_layers)},{map_layers},{','.join(other_layers)}".lstrip(
|
183
183
|
","
|
184
|
-
)
|
184
|
+
).rstrip(",")
|
185
185
|
|
186
186
|
url = f"https://maps.dwd.de/geoserver/dwd/wms?service=WMS&version=1.3.0&request=GetMap&layers={layers}&bbox={miny},{minx},{maxy},{maxx}&width={image_width}&height={image_height}&srs=EPSG:4326&styles=&format=image/png"
|
187
|
-
|
187
|
+
|
188
188
|
request = requests.get(url, stream=True)
|
189
189
|
if request.status_code == 200:
|
190
|
-
|
190
|
+
try:
|
191
|
+
image = Image.open(BytesIO(request.content))
|
192
|
+
except Exception as e:
|
193
|
+
raise RuntimeError(
|
194
|
+
f"Error during image request from DWD servers: {url}"
|
195
|
+
) from e
|
191
196
|
if dark_mode:
|
192
197
|
new_image_data = []
|
193
198
|
for item in image.getdata(): # type: ignore
|
@@ -321,14 +326,18 @@ class ImageLoop:
|
|
321
326
|
layers = (
|
322
327
|
f"{','.join(special_layers)},{map_layers},{','.join(other_layers)}".lstrip(
|
323
328
|
","
|
324
|
-
)
|
329
|
+
).rstrip(",")
|
325
330
|
)
|
326
331
|
url = f"https://maps.dwd.de/geoserver/dwd/wms?service=WMS&version=1.3.0&request=GetMap&layers={layers}&bbox={self._miny},{self._minx},{self._maxy},{self._maxx}&width={self._image_width}&height={self._image_height}&srs=EPSG:4326&styles=&format=image/png&TIME={date.strftime('%Y-%m-%dT%H:%M:00.0Z')}"
|
327
|
-
print(url)
|
328
332
|
request = requests.get(url, stream=True)
|
329
333
|
if request.status_code != 200 or request.headers["content-type"] != "image/png":
|
330
334
|
raise ConnectionError("Error during image request from DWD servers")
|
331
|
-
|
335
|
+
try:
|
336
|
+
image = Image.open(BytesIO(request.content))
|
337
|
+
except Exception as e:
|
338
|
+
raise RuntimeError(
|
339
|
+
f"Error during image request from DWD servers: {url}"
|
340
|
+
) from e
|
332
341
|
if self.dark_mode:
|
333
342
|
new_image_data = []
|
334
343
|
for item in image.getdata(): # type: ignore
|
{simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/RECORD
RENAMED
@@ -1,9 +1,9 @@
|
|
1
1
|
simple_dwd_weatherforecast/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
simple_dwd_weatherforecast/dwdforecast.py,sha256=uZRWMN9RIPvC9r47JAdw_AiP9V9M2rQxh_pOsVF15Sw,39094
|
3
|
-
simple_dwd_weatherforecast/dwdmap.py,sha256=
|
3
|
+
simple_dwd_weatherforecast/dwdmap.py,sha256=wy-WC5JOWeNoqex-A80pvKWo_DyO61_y8E4zvmQ0iLg,14429
|
4
4
|
simple_dwd_weatherforecast/stations.json,sha256=1u8qc2CT_rVy49SAlOicGixzHln6Y0FXevuFAz2maBw,838948
|
5
5
|
simple_dwd_weatherforecast/uv_stations.json,sha256=ADenYo-aR6qbf0UFkfYr72kkFzL9HyUKe4VQ23POGF8,2292
|
6
|
-
simple_dwd_weatherforecast-3.0.
|
6
|
+
simple_dwd_weatherforecast-3.0.1.dist-info/licenses/LICENCE,sha256=27UG7gteqvSWuZlsbIq2_OAbh7VyifGGl-1zpuUoBcw,1072
|
7
7
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
tests/dummy_data.py,sha256=qapeQxjh8kURf5b-9h4gUdJaqQJQDVdqfMtS2g5JReY,103406
|
9
9
|
tests/dummy_data_full.py,sha256=3HRGAQBq4xPYs4jLzoLV_UAe1CXFzOsVBOouDL_5RHw,104062
|
@@ -36,7 +36,7 @@ tests/test_update.py,sha256=AIzzHMxcjwQjeTB0l3YFgB7HkGDbuqiHofwy41mS0m4,7440
|
|
36
36
|
tests/test_update_hourly.py,sha256=7Zl8ml3FTdqw3_Qwr_Tz-sWTzypvrBWmxeig2Vwp_ZQ,1781
|
37
37
|
tests/test_uv_index.py,sha256=tr6wnOyHlXT1S3yp1oeHc4-Brmc-EMEdM4mtyrdpcHg,579
|
38
38
|
tests/test_weather.py,sha256=ZyX4ldUoJpJp7YpiNQwU6Od-nYRay-3qcaDJdNq8fhY,780
|
39
|
-
simple_dwd_weatherforecast-3.0.
|
40
|
-
simple_dwd_weatherforecast-3.0.
|
41
|
-
simple_dwd_weatherforecast-3.0.
|
42
|
-
simple_dwd_weatherforecast-3.0.
|
39
|
+
simple_dwd_weatherforecast-3.0.1.dist-info/METADATA,sha256=4pReGRzr-gEcDD3F78H144vI3aq6vVmmm3BZOFV9gCw,12869
|
40
|
+
simple_dwd_weatherforecast-3.0.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
41
|
+
simple_dwd_weatherforecast-3.0.1.dist-info/top_level.txt,sha256=iyEobUh14Tzitx39Oi8qm0NhBrnZovl_dNKtvLUkLEM,33
|
42
|
+
simple_dwd_weatherforecast-3.0.1.dist-info/RECORD,,
|
{simple_dwd_weatherforecast-3.0.0.dist-info → simple_dwd_weatherforecast-3.0.1.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|