1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added time format info to docstrings

This commit is contained in:
krateng 2022-04-14 17:00:45 +02:00
parent e6bb844ff9
commit 29f722e3d3

View File

@ -39,17 +39,19 @@ api.__apipath__ = "mlj_1"
def add_common_args_to_docstring(filterkeys=False,limitkeys=False,delimitkeys=False,amountkeys=False): def add_common_args_to_docstring(filterkeys=False,limitkeys=False,delimitkeys=False,amountkeys=False):
def decorator(func): def decorator(func):
timeformats = "Possible formats include '2022', '2022/08', '2022/08/01', '2022/W42', 'today', 'thismonth', 'monday', 'august'"
if filterkeys: if filterkeys:
func.__doc__ += """ func.__doc__ += f"""
:param string title: Track title :param string title: Track title
:param string artist: Track artist :param string artist: Track artist
:param bool associated: Whether to include associated artists. :param bool associated: Whether to include associated artists.
""" """
if limitkeys: if limitkeys:
func.__doc__ += """ func.__doc__ += f"""
:param string from: Start of the desired time range. Can also be called since or start. :param string from: Start of the desired time range. Can also be called since or start. {timeformats}
:param string until: End of the desired range. Can also be called to or end. :param string until: End of the desired range. Can also be called to or end. {timeformats}
:param string in: Desired range. Can also be called within or during. :param string in: Desired range. Can also be called within or during. {timeformats}
""" """
if delimitkeys: if delimitkeys:
func.__doc__ += """ func.__doc__ += """