Skip to content

Commit

Permalink
ExternalResources: Allow to set data_home when instancating the class
Browse files Browse the repository at this point in the history
  • Loading branch information
loichuder committed Jul 25, 2024
1 parent 3ad594b commit e4ed210
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 e4ed210

Please sign in to comment.