File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def _setup():
5555 config = _parse_config ()
5656 apikey = config .get ('FAKE_SECTION' , 'apikey' )
5757 server = config .get ('FAKE_SECTION' , 'server' )
58- cache_directory = config .get ('FAKE_SECTION' , 'cachedir' )
58+ cache_directory = os . path . expanduser ( config .get ('FAKE_SECTION' , 'cachedir' ) )
5959 avoid_duplicate_runs = config .getboolean ('FAKE_SECTION' , 'avoid_duplicate_runs' )
6060
6161
@@ -105,8 +105,27 @@ def get_cache_directory():
105105 return _cachedir
106106
107107
108+ def set_cache_directory (cachedir ):
109+ """Set module-wide cache directory.
110+
111+ Sets the cache directory into which to download datasets, tasks etc.
112+
113+ Parameters
114+ ----------
115+ cachedir : string
116+ Path to use as cache directory.
117+
118+ See also
119+ --------
120+ get_cache_directory
121+ """
122+
123+ global cache_directory
124+ cache_directory = cachedir
125+
126+
108127__all__ = [
109- 'get_cache_directory' ,
128+ 'get_cache_directory' , 'set_cache_directory'
110129]
111130
112131_setup ()
You can’t perform that action at this time.
0 commit comments