Skip to content

Commit ad6b910

Browse files
committed
renaming cache config class
1 parent d992eca commit ad6b910

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

astroquery/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _get_bibtex():
4242

4343

4444
# Set up cache configuration
45-
class Conf(_config.ConfigNamespace):
45+
class Cache_Conf(_config.ConfigNamespace):
4646

4747
cache_timeout = _config.ConfigItem(
4848
604800, # 1 week
@@ -57,4 +57,4 @@ class Conf(_config.ConfigNamespace):
5757
)
5858

5959

60-
conf = Conf()
60+
cache_conf = Cache_Conf()

astroquery/query.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from astropy.utils import deprecated
2222
from astropy.utils.exceptions import AstropyDeprecationWarning
2323

24-
from astroquery import version, log, conf
24+
from astroquery import version, log, cache_conf
2525
from astroquery.utils import system_tools
2626

2727

@@ -311,7 +311,7 @@ def _request(self, method, url,
311311
is True.
312312
"""
313313

314-
cache &= conf.cache_active
314+
cache &= cache_conf.cache_active
315315

316316
if save:
317317
local_filename = url.split('/')[-1]
@@ -335,13 +335,13 @@ def _request(self, method, url,
335335
query = AstroQuery(method, url, params=params, data=data, headers=headers,
336336
files=files, timeout=timeout, json=json)
337337
if (self.cache_location is None) or (not cache):
338-
with conf.set_temp("cache_active", False):
338+
with cache_conf.set_temp("cache_active", False):
339339
response = query.request(self._session, stream=stream,
340340
auth=auth, verify=verify,
341341
allow_redirects=allow_redirects,
342342
json=json)
343343
else:
344-
response = query.from_cache(self.cache_location, conf.cache_timeout)
344+
response = query.from_cache(self.cache_location, cache_conf.cache_timeout)
345345
if not response:
346346
response = query.request(self._session,
347347
self.cache_location,
@@ -485,7 +485,7 @@ class suspend_cache:
485485
"""
486486

487487
def __init__(self, obj=None):
488-
self.original_cache_setting = conf.cache_active
488+
self.original_cache_setting = cache_conf.cache_active
489489

490490
def __enter__(self):
491491
conf.cache_active = False

0 commit comments

Comments
 (0)