Skip to content

Commit

Permalink
make path location get/set work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ceb8 committed Mar 16, 2023
1 parent 23affe0 commit 460fd24
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions astroquery/mast/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ def _login(self, token=None, store_token=False, reenter_token=False):

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

@property
def cache_location(self):
cl = self._portal_api_connection.cache_location
cl_2 = self._service_api_connection.cache_location

if cl != cl_2:
print("What should we do in this case? (currently setting it by force)")
self._service_api_connection.cache_location = cl

return cl

@cache_location.setter
def cache_location(self, loc):
self._portal_api_connection.cache_location = loc
self._service_api_connection.cache_location = loc

def reset_cache_location(self):
"""Resets the cache location to the default astropy cache"""
self._portal_api_connection.reset_cache_location()
self._service_api_connection.reset_cache_location()

def session_info(self, verbose=True):
"""
Displays information about current MAST user, and returns user info dictionary.
Expand Down
2 changes: 2 additions & 0 deletions astroquery/mast/discovery_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def __init__(self, session=None):
if session:
self._session = session

self.name = "Mast"

def _request(self, method, url, params=None, data=None, headers=None,
files=None, stream=False, auth=None, retrieve_all=True):
"""
Expand Down

0 comments on commit 460fd24

Please sign in to comment.