|
8 | 8 | import keyring |
9 | 9 | import io |
10 | 10 | import os |
11 | | -import warnings |
12 | 11 | import requests |
13 | 12 | import textwrap |
14 | 13 |
|
15 | 14 | from datetime import datetime, timedelta |
16 | 15 | from pathlib import Path |
17 | 16 |
|
18 | 17 | from astropy.config import paths |
19 | | -from astroquery import log |
20 | 18 | import astropy.units as u |
21 | 19 | from astropy.utils.console import ProgressBarOrSpinner |
22 | 20 | import astropy.utils.data |
23 | 21 |
|
24 | | -from . import version |
25 | | -from .utils import system_tools |
26 | | -from astroquery import conf |
| 22 | +from astroquery import version, log, conf |
| 23 | +from astroquery.utils import system_tools |
| 24 | + |
27 | 25 |
|
28 | 26 | __all__ = ['BaseQuery', 'QueryWithLogin'] |
29 | 27 |
|
@@ -199,7 +197,6 @@ def __init__(self): |
199 | 197 |
|
200 | 198 | self.name = self.__class__.__name__.split("Class")[0] |
201 | 199 | self._cache_active = conf.use_cache |
202 | | - self.use_cache = conf.use_cache |
203 | 200 | self.cache_timeout = conf.default_cache_timeout |
204 | 201 |
|
205 | 202 |
|
@@ -255,7 +252,7 @@ def reset_cache_preferences(self): |
255 | 252 | conf.cache_location, |
256 | 253 | self.__class__.__name__.split("Class")[0]) |
257 | 254 |
|
258 | | - self.use_cache = conf.use_cache |
| 255 | + self._cache_active = conf.use_cache |
259 | 256 | self.cache_timeout = conf.default_cache_timeout |
260 | 257 |
|
261 | 258 | def _request(self, method, url, |
@@ -328,7 +325,7 @@ def _request(self, method, url, |
328 | 325 | json=json |
329 | 326 | ) |
330 | 327 |
|
331 | | - if (cache is not False) and self.use_cache: |
| 328 | + if (cache is not False) and self._cache_active: |
332 | 329 | cache = True |
333 | 330 | else: |
334 | 331 | cache = False |
|
0 commit comments