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

silx.utils.ExternalResources: Allow to set data_home when instantiating the class #4151

Merged
merged 1 commit into from
Jul 26, 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
5 changes: 3 additions & 2 deletions src/silx/utils/ExternalResources.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ExternalResources(object):

"""

def __init__(self, project, url_base, env_key=None, timeout=60):
def __init__(self, project, url_base, env_key=None, timeout=60, data_home=None):
"""Constructor of the class

:param str project: name of the project, like "silx"
Expand All @@ -65,6 +65,7 @@ def __init__(self, project, url_base, env_key=None, timeout=60):
The environment variable is optional: in case it is not set,
a directory in the temporary folder is used.
:param timeout: time in seconds before it breaks
:param data_home: Directory in which the data will be downloaded
"""
self.project = project
self._initialized = False
Expand All @@ -74,7 +75,7 @@ def __init__(self, project, url_base, env_key=None, timeout=60):
self.url_base = url_base
self.all_data = {}
self.timeout = timeout
self._data_home = None
self._data_home = data_home

@property
def data_home(self):
Expand Down