Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EUMETSAT poll plugin update #1027

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion sarracenia/flowcb/poll/eumetsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
- 2023-12: updated sr3 plugin, split into separate poll and auth plugins, made a lot more universal (old code
would only post NetCDF files, this allows any type, configurable time range, multiple collection IDs
in one config, includes mtime, md5sum, GeoJSON, contentType in messages when available)
- 2024-04: un-URL-encode the posted relPath
"""
import requests
import datetime
Expand Down Expand Up @@ -184,7 +185,13 @@ def msg_from_link_info_json(self, link_info) -> sarracenia.Message:
# The download links in .../entry?name=FILENAME which would download files named entry?name=FILENAME
# Override this by changing relPath (used to name the file) and setting retrievePath (used to download)
m['retrievePath'] = m['relPath']
m['relPath'] = m['relPath'].replace('entry?name=', '')
temp_relPath = requests.utils.unquote(m['relPath'].replace('entry?name=', '')).split('/')
relPath = []
# remove duplicates from the path
for i in range(len(temp_relPath)):
if i == 0 or temp_relPath[i] != temp_relPath[i-1]:
relPath.append(temp_relPath[i])
m['relPath'] = '/'.join(relPath)
except Exception as e:
logger.error(f"Failed to create message from {link_info}")
logger.debug("Exception details", exc_info=True)
Expand Down
Loading