Skip to content

Commit 1ef7a38

Browse files
committed
cleanup after rebase
1 parent fe23c11 commit 1ef7a38

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

astroquery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _get_bibtex():
5454
class Conf(_config.ConfigNamespace):
5555

5656
default_cache_timeout = _config.ConfigItem(
57-
86400, # 24 hours
57+
604800 , # 1 week
5858
'Astroquery-wide default cache timeout (seconds).'
5959
)
6060
cache_location = _config.ConfigItem(

astroquery/query.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@
1010
import keyring
1111
import io
1212
import os
13-
import warnings
1413
import requests
1514
import textwrap
1615

1716
from datetime import datetime, timedelta
1817
from pathlib import Path
1918

2019
from astropy.config import paths
21-
from astroquery import log
2220
import astropy.units as u
2321
from astropy.utils.console import ProgressBarOrSpinner
2422
import astropy.utils.data
2523

26-
from . import version
27-
from .utils import system_tools
28-
from astroquery import conf
24+
from astroquery import version, log, conf
25+
from astroquery.utils import system_tools
26+
2927

3028
__all__ = ['BaseQuery', 'QueryWithLogin']
3129

@@ -133,7 +131,7 @@ def from_cache(self, cache_location, cache_timeout):
133131
else:
134132
log.debug("Cache expired for {0}...".format(request_file))
135133
response = None
136-
except IOError: # TODO: change to FileNotFoundError once drop py2 support
134+
except FileNotFoundError:
137135
response = None
138136
if response:
139137
log.debug("Retrieved data from {0}".format(request_file))
@@ -201,7 +199,6 @@ def __init__(self):
201199

202200
self.name = self.__class__.__name__.split("Class")[0]
203201
self._cache_active = conf.use_cache
204-
self.use_cache = conf.use_cache
205202
self.cache_timeout = conf.default_cache_timeout
206203

207204

@@ -257,7 +254,7 @@ def reset_cache_preferences(self):
257254
conf.cache_location,
258255
self.__class__.__name__.split("Class")[0])
259256

260-
self.use_cache = conf.use_cache
257+
self._cache_active = conf.use_cache
261258
self.cache_timeout = conf.default_cache_timeout
262259

263260
def _request(self, method, url,
@@ -330,7 +327,7 @@ def _request(self, method, url,
330327
json=json
331328
)
332329

333-
if (cache is not False) and self.use_cache:
330+
if (cache is not False) and self._cache_active:
334331
cache = True
335332
else:
336333
cache = False

astroquery/setup_package.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33

44
def get_package_data():
55
return {'astroquery': ['CITATION']}
6-

0 commit comments

Comments
 (0)