# HG changeset patch # User ioannis@ioannis-VirtualBox # Date 1620311389 -10800 # Node ID 33a1ebad3f7e69a44be4dcdcfa3a56d6d4b8a438 # Parent c4e03940780a4482a674f9db0169bae456300626 Bug fix when downloading processed files. diff -r c4e03940780a -r 33a1ebad3f7e CHANGELOG.rst --- a/CHANGELOG.rst Mon Apr 26 12:15:02 2021 +0300 +++ b/CHANGELOG.rst Thu May 06 17:29:49 2021 +0300 @@ -1,5 +1,8 @@ Changelog ========= +0.10.3 - 2021-05-06 +------------------- +* Fixed bug when downloading measurement files. 0.10.1 - 2021-02-09 ------------------- @@ -7,7 +10,7 @@ 0.10.0 - 2021-02-04 ------------------- -* Support for new version of web interface (to be released on 2021-02-09. +* Support for new version of web interface (to be released on 2021-02-09). * Output of module exit codes and their description. * Support of the "delay" parameter when uploading files. diff -r c4e03940780a -r 33a1ebad3f7e scc_access/__init__.py --- a/scc_access/__init__.py Mon Apr 26 12:15:02 2021 +0300 +++ b/scc_access/__init__.py Thu May 06 17:29:49 2021 +0300 @@ -1,1 +1,1 @@ -__version__ = "0.10.2" \ No newline at end of file +__version__ = "0.10.3" \ No newline at end of file diff -r c4e03940780a -r 33a1ebad3f7e scc_access/scc_access.py --- a/scc_access/scc_access.py Mon Apr 26 12:15:02 2021 +0300 +++ b/scc_access/scc_access.py Thu May 06 17:29:49 2021 +0300 @@ -378,6 +378,7 @@ # try to wait for measurement to appear in API measurement = None logger.info("Looking for measurement %s on the SCC.", measurement_id) + while attempts_count < max_attempts: attempts_count += 1 measurement, status = self.get_measurement(measurement_id) @@ -388,8 +389,9 @@ time.sleep(time_sleep) else: break + print("Measurement: {}".format(measurement)) - if attempts_count == max_attempts: + if measurement is None: logger.error("Measurement %s doesn't seem to exist.", measurement_id) if exit_if_missing: sys.exit(1) @@ -397,37 +399,35 @@ return measurement logger.info('Measurement %s found.', measurement_id) + while not measurement.has_finished: + measurement.log_processing_status() + time.sleep(10) + measurement, status = self.get_measurement(measurement_id) - if measurement is not None: - while not measurement.has_finished: - measurement.log_processing_status() - time.sleep(10) - measurement, status = self.get_measurement(measurement_id) - - logger.info("Measurement processing finished.") - measurement.log_detailed_status() + logger.info("Measurement processing finished.") + measurement.log_detailed_status() - if measurement.hirelpp == 127: - logger.info("Downloading HiRElPP files.") - self.download_hirelpp(measurement_id) - if measurement.cloudmask == 127: - logger.info("Downloading cloud screening files.") - self.download_cloudmask(measurement_id) - if measurement.elpp == 127: - logger.info("Downloading ElPP files.") - self.download_elpp(measurement_id) - if measurement.elda == 127: - logger.info("Downloading ELDA files.") - self.download_elda(measurement_id) - logger.info("Downloading ELDA plots.") - self.download_plots(measurement_id) - if measurement.elic == 127: - logger.info("Downloading ELIC files.") - self.download_elic(measurement_id) - if measurement.is_calibration and measurement.eldec==0: - logger.info("Downloading ELDEC files.") - self.download_eldec(measurement_id) - logger.info("--- Processing finished. ---") + if measurement.hirelpp == 127: + logger.info("Downloading HiRElPP files.") + self.download_hirelpp(measurement_id) + if measurement.cloudmask == 127: + logger.info("Downloading cloud screening files.") + self.download_cloudmask(measurement_id) + if measurement.elpp == 127: + logger.info("Downloading ElPP files.") + self.download_elpp(measurement_id) + if measurement.elda == 127: + logger.info("Downloading ELDA files.") + self.download_elda(measurement_id) + logger.info("Downloading ELDA plots.") + self.download_plots(measurement_id) + if measurement.elic == 127: + logger.info("Downloading ELIC files.") + self.download_elic(measurement_id) + if measurement.is_calibration and measurement.eldec==0: + logger.info("Downloading ELDEC files.") + self.download_eldec(measurement_id) + logger.info("--- Processing finished. ---") return measurement