Skip to content

Commit 5137807

Browse files
committed
Update configuration item names in template
The template core module allows users to set configuration items in two ways, either through the `astropy` configuration system or through class or instance attributes. The attribute names are no longer in capital letters because the convention is to reserve such names for constants, and the configuration item names now match the attribute names.
1 parent cbd4900 commit 5137807

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

astroquery/template_module/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Conf(_config.ConfigNamespace):
1818
"""
1919
Configuration parameters for `astroquery.template_module`.
2020
"""
21-
server = _config.ConfigItem(
21+
url = _config.ConfigItem(
2222
['http://dummy_server_mirror_1',
2323
'http://dummy_server_mirror_2',
2424
'http://dummy_server_mirror_n'],

astroquery/template_module/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ class TemplateClass(BaseQuery):
4545
# The private properties defined here allow the users to change the
4646
# configuration values at runtime, or to completely override them with
4747
# instance attributes.
48-
URL = '' # A falsy default that cannot be mistaken for a valid value.
49-
TIMEOUT = None # Use `None` if the falsy value could be valid.
48+
url = '' # A falsy default that cannot be mistaken for a valid value.
49+
timeout = None # Use `None` if the falsy value could be valid.
5050

5151
@property
5252
def _url(self):
53-
return self.URL or conf.server
53+
return self.url or conf.url
5454

5555
@property
5656
def _timeout(self):
57-
return conf.timeout if self.TIMEOUT is None else self.TIMEOUT
57+
return conf.timeout if self.timeout is None else self.timeout
5858

5959
# all query methods are implemented with an "async" method that handles
6060
# making the actual HTTP request and returns the raw HTTP response, which

0 commit comments

Comments
 (0)