From 5137807fee8967671294e607dfb7c2a4745fabf6 Mon Sep 17 00:00:00 2001 From: Eero Vaher Date: Mon, 28 Mar 2022 19:35:40 +0200 Subject: [PATCH] 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. --- astroquery/template_module/__init__.py | 2 +- astroquery/template_module/core.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/astroquery/template_module/__init__.py b/astroquery/template_module/__init__.py index ab6aa76061..d9eb2e702f 100644 --- a/astroquery/template_module/__init__.py +++ b/astroquery/template_module/__init__.py @@ -18,7 +18,7 @@ class Conf(_config.ConfigNamespace): """ Configuration parameters for `astroquery.template_module`. """ - server = _config.ConfigItem( + url = _config.ConfigItem( ['http://dummy_server_mirror_1', 'http://dummy_server_mirror_2', 'http://dummy_server_mirror_n'], diff --git a/astroquery/template_module/core.py b/astroquery/template_module/core.py index ac14263df7..907f34725c 100644 --- a/astroquery/template_module/core.py +++ b/astroquery/template_module/core.py @@ -45,16 +45,16 @@ class TemplateClass(BaseQuery): # The private properties defined here allow the users to change the # configuration values at runtime, or to completely override them with # instance attributes. - URL = '' # A falsy default that cannot be mistaken for a valid value. - TIMEOUT = None # Use `None` if the falsy value could be valid. + url = '' # A falsy default that cannot be mistaken for a valid value. + timeout = None # Use `None` if the falsy value could be valid. @property def _url(self): - return self.URL or conf.server + return self.url or conf.url @property def _timeout(self): - return conf.timeout if self.TIMEOUT is None else self.TIMEOUT + return conf.timeout if self.timeout is None else self.timeout # all query methods are implemented with an "async" method that handles # making the actual HTTP request and returns the raw HTTP response, which