# HG changeset patch # User Iannis # Date 1576845381 -7200 # Node ID 8acea12976c4af6c71ac3c224be530a1cbde1a21 # Parent 7f9605b75689dcee74a32ad60ad5c9ea977f729f Bug fix: Handling of full paths in ancillary files. diff -r 7f9605b75689 -r 8acea12976c4 CHANGELOG.rst --- a/CHANGELOG.rst Thu Dec 19 18:03:16 2019 +0200 +++ b/CHANGELOG.rst Fri Dec 20 14:36:21 2019 +0200 @@ -1,6 +1,14 @@ Changelog ========= +0.8.1 - 2019-12-19 +------------------ +* Correct handling of ancillary file full paths (thanks to Marc-Antoine Drouin) + +0.8.0 - 2019-12-19 +------------------ +* Check if ancillary file is already in the SCC DB before uploading. + 0.7.1 - 2019-12-05 ------------------ * Fixed handling of both old- and new-style measurement ids. diff -r 7f9605b75689 -r 8acea12976c4 scc_access/scc_access.py --- a/scc_access/scc_access.py Thu Dec 19 18:03:16 2019 +0200 +++ b/scc_access/scc_access.py Fri Dec 20 14:36:21 2019 +0200 @@ -13,7 +13,7 @@ from io import BytesIO import sys import time -import urlparse + from zipfile import ZipFile import yaml @@ -472,7 +472,7 @@ return measurement_id - def get_ancillary(self, filename, file_type): + def get_ancillary(self, file_path, file_type): """ Try to get the ancillary file data from the SCC API. @@ -480,8 +480,8 @@ Parameters ---------- - filename : str - Filename of the uploaded file. + file_path : str + Path of the uploaded file. file_type : str Type of ancillary file. One of 'sounding', 'overlap', 'lidarratio'. @@ -491,6 +491,8 @@ """ assert file_type in ['sounding', 'overlap', 'lidarratio'] + filename = os.path.basename(file_path) + if file_type == 'sounding': file_url = self.api_sounding_search_pattern.format(filename) elif file_type == 'overlap':