|
4 | 4 | from astropy import config as _config |
5 | 5 | from astropy.config import paths |
6 | 6 | from astropy.utils.exceptions import AstropyDeprecationWarning |
| 7 | +from astropy.utils.decorators import deprecated_attribute |
7 | 8 |
|
8 | 9 | import os |
9 | 10 |
|
@@ -32,47 +33,9 @@ class Conf(_config.ConfigNamespace): |
32 | 33 | ESASKY_ROW_LIMIT = _config.ConfigItem(10000, 'Maximum number of rows returned (set to -1 for unlimited).', |
33 | 34 | aliases=['astroquery.esasky.row_limit']) |
34 | 35 |
|
35 | | - @property |
36 | | - def urlBase(self): |
37 | | - return self.ESASKY_DOMAIN_SERVER |
38 | | - |
39 | | - @urlBase.setter |
40 | | - def urlBase(self, value): |
41 | | - warnings.warn( |
42 | | - "'urlBase' is deprecated and will be removed in a future version. " |
43 | | - "Use 'ESASKY_DOMAIN_SERVER' instead.", |
44 | | - AstropyDeprecationWarning, |
45 | | - stacklevel=2, |
46 | | - ) |
47 | | - self.ESASKY_DOMAIN_SERVER = value |
48 | | - |
49 | | - @property |
50 | | - def timeout(self): |
51 | | - return self.ESASKY_CONNECTION_TIMEOUT |
52 | | - |
53 | | - @timeout.setter |
54 | | - def timeout(self, value): |
55 | | - warnings.warn( |
56 | | - "'timeout' is deprecated and will be removed in a future version. " |
57 | | - "Use 'ESASKY_CONNECTION_TIMEOUT' instead.", |
58 | | - AstropyDeprecationWarning, |
59 | | - stacklevel=2, |
60 | | - ) |
61 | | - self.ESASKY_CONNECTION_TIMEOUT = value |
62 | | - |
63 | | - @property |
64 | | - def row_limit(self): |
65 | | - return self.ESASKY_ROW_LIMIT |
66 | | - |
67 | | - @row_limit.setter |
68 | | - def row_limit(self, value): |
69 | | - warnings.warn( |
70 | | - "'row_limit' is deprecated and will be removed in a future version. " |
71 | | - "Use 'ESASKY_ROW_LIMIT' instead.", |
72 | | - AstropyDeprecationWarning, |
73 | | - stacklevel=2, |
74 | | - ) |
75 | | - self.ESASKY_ROW_LIMIT = value |
| 36 | + urlBase = deprecated_attribute(name='urlBase', alternative='ESASKY_DOMAIN_SERVER', since='8.0') |
| 37 | + timeout = deprecated_attribute(name='timeout', alternative='ESASKY_CONNECTION_TIMEOUT', since='8.0') |
| 38 | + row_limit = deprecated_attribute(name='row_limit', alternative='ESASKY_ROW_LIMIT', since='8.0') |
76 | 39 |
|
77 | 40 | cache_location = os.path.join(paths.get_cache_dir(), 'astroquery/esasky', ) |
78 | 41 |
|
|
0 commit comments