Skip to content

Commit a561629

Browse files
committed
renaming cache config class
1 parent f0902eb commit a561629

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
@@ -52,7 +52,7 @@ def _get_bibtex():
5252

5353

5454
# Set up cache configuration
55-
class Conf(_config.ConfigNamespace):
55+
class Cache_Conf(_config.ConfigNamespace):
5656

5757
cache_timeout = _config.ConfigItem(
5858
604800, # 1 week
@@ -67,4 +67,4 @@ class Conf(_config.ConfigNamespace):
6767
)
6868

6969

70-
conf = Conf()
70+
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

@@ -319,7 +319,7 @@ def _request(self, method, url,
319319
json=json
320320
)
321321

322-
cache &= conf.cache_active
322+
cache &= cache_conf.cache_active
323323

324324
if save:
325325
local_filename = url.split('/')[-1]
@@ -341,13 +341,13 @@ def _request(self, method, url,
341341
else:
342342
query = AstroQuery(method, url, **req_kwargs)
343343
if (self.cache_location is None) or (not cache):
344-
with conf.set_temp("cache_active", False):
344+
with cache_conf.set_temp("cache_active", False):
345345
response = query.request(self._session, stream=stream,
346346
auth=auth, verify=verify,
347347
allow_redirects=allow_redirects,
348348
json=json)
349349
else:
350-
response = query.from_cache(self.cache_location, conf.cache_timeout)
350+
response = query.from_cache(self.cache_location, cache_conf.cache_timeout)
351351
if not response:
352352
response = query.request(self._session,
353353
self.cache_location,
@@ -491,7 +491,7 @@ class suspend_cache:
491491
"""
492492

493493
def __init__(self, obj=None):
494-
self.original_cache_setting = conf.cache_active
494+
self.original_cache_setting = cache_conf.cache_active
495495

496496
def __enter__(self):
497497
conf.cache_active = False

0 commit comments

Comments
 (0)