@@ -109,7 +109,7 @@ def wrapper_decorator(alyx_client, *args, expires=None, clobber=False, **kwargs)
109109 response will not be used on subsequent calls. If None, the default expiry is applied.
110110 clobber : bool
111111 If True any existing cached response is overwritten.
112- ** kwargs
112+ kwargs
113113 Keyword arguments for applying to wrapped function.
114114
115115 Returns
@@ -123,7 +123,7 @@ def wrapper_decorator(alyx_client, *args, expires=None, clobber=False, **kwargs)
123123 if args [0 ].__name__ != mode and mode != '*' :
124124 return method (alyx_client , * args , ** kwargs )
125125 # Check cache
126- rest_cache = alyx_client .cache_dir . joinpath ( '.rest' )
126+ rest_cache = alyx_client .rest_cache_dir
127127 sha1 = hashlib .sha1 ()
128128 sha1 .update (bytes (args [1 ], 'utf-8' ))
129129 name = sha1 .hexdigest ()
@@ -577,6 +577,7 @@ def __init__(self, base_url=None, username=None, password=None,
577577 # The default expiry is overridden by the `expires` kwarg. If False, the caching is
578578 # turned off.
579579 self .default_expiry = timedelta (minutes = 5 )
580+ self .rest_cache_dir = self .cache_dir .joinpath ('.rest' )
580581 self .cache_mode = cache_rest
581582 self ._obj_id = id (self )
582583
@@ -1368,5 +1369,5 @@ def json_field_delete(
13681369
13691370 def clear_rest_cache (self ):
13701371 """Clear all REST response cache files for the base url."""
1371- for file in self .cache_dir . joinpath ( '.rest' ) .glob ('*' ):
1372+ for file in self .rest_cache_dir .glob ('*' ):
13721373 file .unlink ()
0 commit comments