Skip to content

Commit

Permalink
Merge pull request #4151 from silx-kit/ext-resources-home
Browse files Browse the repository at this point in the history
silx.utils.ExternalResources: Allow to set data_home when instantiating the class
  • Loading branch information
loichuder committed Jul 26, 2024
2 parents 3ad594b + 4b4e049 commit a7da263
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit a7da263

Please sign in to comment.