diff --git a/astroquery/template_module/core.py b/astroquery/template_module/core.py index 907f34725c..36dd5be796 100644 --- a/astroquery/template_module/core.py +++ b/astroquery/template_module/core.py @@ -36,17 +36,16 @@ @async_to_sync class TemplateClass(BaseQuery): - """ - Not all the methods below are necessary but these cover most of the common - cases, new methods may be added if necessary, follow the guidelines at - - """ + # `__init__()` allows the user to conveniently set the instance attributes + # to override the configuration items. The default attribute values should + # be falsy (`x` is called falsy if `bool(x)` is `False`) or `None`. + def __init__(self, url='', timeout=None): + self.url = url # A falsy default that cannot be mistaken for a valid value. + self.timeout = timeout # Use `None` as default if the falsy value could be valid. # 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. + # configuration values at runtime if the corresponding instance attributes + # have default values. @property def _url(self): @@ -56,6 +55,12 @@ def _url(self): def _timeout(self): return conf.timeout if self.timeout is None else self.timeout + """ + Not all the methods below are necessary but these cover most of the common + cases, new methods may be added if necessary, follow the guidelines at + + """ + # all query methods are implemented with an "async" method that handles # making the actual HTTP request and returns the raw HTTP response, which # should be parsed by a separate _parse_result method. The query_object @@ -332,7 +337,7 @@ def extract_image_urls(self, html_str): pass -# the default tool for users to interact with is an instance of the Class +# the default tool for users to interact with is a default instance of the Class Template = TemplateClass() # once your class is done, tests should be written