Skip to content

Commit d377e99

Browse files
committed
make path location get/set work properly
1 parent d35b0b5 commit d377e99

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

astroquery/mast/core.py

+21
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,27 @@ def _login(self, token=None, store_token=False, reenter_token=False):
6565

6666
return self._auth_obj.login(token, store_token, reenter_token)
6767

68+
@property
69+
def cache_location(self):
70+
cl = self._portal_api_connection.cache_location
71+
cl_2 = self._service_api_connection.cache_location
72+
73+
if cl != cl_2:
74+
print("What should we do in this case? (currently setting it by force)")
75+
self._service_api_connection.cache_location = cl
76+
77+
return cl
78+
79+
@cache_location.setter
80+
def cache_location(self, loc):
81+
self._portal_api_connection.cache_location = loc
82+
self._service_api_connection.cache_location = loc
83+
84+
def reset_cache_location(self):
85+
"""Resets the cache location to the default astropy cache"""
86+
self._portal_api_connection.reset_cache_location()
87+
self._service_api_connection.reset_cache_location()
88+
6889
def session_info(self, verbose=True):
6990
"""
7091
Displays information about current MAST user, and returns user info dictionary.

astroquery/mast/discovery_portal.py

+2
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def __init__(self, session=None):
135135
if session:
136136
self._session = session
137137

138+
self.name = "Mast"
139+
138140
def _request(self, method, url, params=None, data=None, headers=None,
139141
files=None, stream=False, auth=None, retrieve_all=True):
140142
"""

0 commit comments

Comments
 (0)