Skip to content

Commit

Permalink
Concise station id parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
FL550 committed Sep 20, 2024
1 parent a50c11c commit c56039d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simple_dwd_weatherforecast/dwdforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,9 +998,12 @@ def download_large_kml(self, stationid):
save_next_next = True
save_next = False

if stationid.encode() in chunk:
if f"<kml:name>{stationid}</kml:name>".encode() in chunk:
chunk1 = chunk
save_next = True

if not chunk1:
raise BufferError("Station not found")
if first_chunk:
start = placemark.find(b"<kml:Placemark>\n")

Expand Down

0 comments on commit c56039d

Please sign in to comment.