Skip to content

Commit

Permalink
0.1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
semiautomaticgit committed Dec 2, 2023
1 parent 94ff3a7 commit 2b069d3
Show file tree
Hide file tree
Showing 11 changed files with 490 additions and 109 deletions.
12 changes: 12 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
===============

v0.1.19
________

* Fixed Copernicus search and download service

v0.1.18
________

* Added Copernicus download service from
https://catalogue.dataspace.copernicus.eu
if copernicus_user and copernicus_password are provided.

v0.1.17
________

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
project = 'Remotior Sensus'
copyright = '2022-2023, Luca Congedo'
author = 'Luca Congedo'
release = '0.1.17'
version = '0.1.17.1'
release = '0.1.19'
version = '0.1.19.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/remotior_sensus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
from remotior_sensus.core.session import Session
from remotior_sensus.core import configurations

__version__ = '0.1.17'
__version__ = '0.1.19'

configurations.version = __version__
5 changes: 3 additions & 2 deletions src/remotior_sensus/core/multiprocess_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,8 @@ def multi_download_file(
self, url_list, output_path_list, authentication_uri=None,
user=None, password=None, proxy_host=None, proxy_port=None,
proxy_user=None, proxy_password=None, progress=None, message=None,
min_progress=0, max_progress=100, retried=False, timeout=20
min_progress=0, max_progress=100, retried=False, timeout=20,
copernicus=False, access_token=None
):
cfg.logger.log.debug('start')
cfg.logger.log.debug('url_list: %s' % str(url_list))
Expand All @@ -2293,7 +2294,7 @@ def multi_download_file(
input_parameters = [
url_list, output_path_list, authentication_uri, user, password,
proxy_host, proxy_port, proxy_user, proxy_password, retried,
timeout
timeout, copernicus, access_token
]
# progress queue
p_mq = self.manager.Queue()
Expand Down
30 changes: 22 additions & 8 deletions src/remotior_sensus/core/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,8 @@ def download_file_processor(input_parameters, process_parameters=None):
proxy_password = input_parameters[8]
retried = input_parameters[9]
timeout = input_parameters[10]
copernicus = input_parameters[11]
access_token = input_parameters[12]
start_time = datetime.datetime.now()
cfg.logger.log.debug('url_list: %s' % str(url_list))
for url in range(len(url_list)):
Expand All @@ -1565,14 +1567,26 @@ def download_file_processor(input_parameters, process_parameters=None):
if process_id == 0 and elapsed_time > refresh_time:
start_time = now_time
progress_queue.put([url, len(url_list)], False)
downloaded = download_tools.download_file(
url=url_list[url], output_path=output_path_list[url],
authentication_uri=authentication_uri, user=user,
password=password, proxy_host=proxy_host, proxy_port=proxy_port,
proxy_user=proxy_user, proxy_password=proxy_password,
progress=True, retried=retried, timeout=timeout,
callback=progress_queue.put, log=cfg.logger.log
)
if copernicus is True:
downloaded = download_tools.download_copernicus_file(
url=url_list[url], output_path=output_path_list[url],
authentication_uri=authentication_uri,
proxy_host=proxy_host, proxy_port=proxy_port,
proxy_user=proxy_user, proxy_password=proxy_password,
progress=True, retried=retried, timeout=timeout,
callback=progress_queue.put, log=cfg.logger.log,
access_token=access_token
)
else:
downloaded = download_tools.download_file(
url=url_list[url], output_path=output_path_list[url],
authentication_uri=authentication_uri, user=user,
password=password, proxy_host=proxy_host,
proxy_port=proxy_port,
proxy_user=proxy_user, proxy_password=proxy_password,
progress=True, retried=retried, timeout=timeout,
callback=progress_queue.put, log=cfg.logger.log
)
if downloaded is None:
cfg.logger.log.debug('error downloading: %s' % url_list[url])
logger = cfg.logger.stream.getvalue()
Expand Down
5 changes: 3 additions & 2 deletions src/remotior_sensus/core/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def create_root_temporary_directory(cls, prefix=None, directory=None):

# clear root temporary directory
def clear(self):
remove_root_temporary_directory(self.dir)
self.dir = None
if self.dir is not None:
remove_root_temporary_directory(self.dir)
self.dir = None
return self.dir

# create temporary directory
Expand Down
Loading

0 comments on commit 2b069d3

Please sign in to comment.