From 318d9ad1a4679832b380c77ab1a0a86684f686f2 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Fri, 1 Dec 2023 15:33:21 -0800 Subject: Switch to Google-style docstrings for readability The previous Sphinx-style docstrings could be hard to read at a glance when formatted with pydoc. --- src/wikiget/parse.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/wikiget/parse.py') diff --git a/src/wikiget/parse.py b/src/wikiget/parse.py index 026062e..9017d3a 100644 --- a/src/wikiget/parse.py +++ b/src/wikiget/parse.py @@ -38,13 +38,15 @@ logger = logging.getLogger(__name__) def get_dest(dl: str, args: Namespace) -> File: """Parse the given download target for filename, destination, and site host. - :param dl: download target (filename or URL) - :type dl: str - :param args: command-line arguments and their values - :type args: argparse.Namespace - :raises ParseError: the target was unable to be parsed as a valid file - :return: a File object representing the target, destination, and site - :rtype: wikiget.file.File + Args: + dl (str): download target (filename or URL) + args (argparse.Namespace): command-line arguments and their values + + Raises: + ParseError: the target was unable to be parsed as a valid file + + Returns: + wikiget.file.File: a File object representing the target, destination, and site """ url = urlparse(dl) @@ -81,10 +83,11 @@ def read_batch_file(batch_file: str) -> dict[int, str]: The contents are returned as a dictionary with line numbers for keys and line contents for values. Any blank lines or lines starting with '#' are skipped. - :param batch_file: name of the file to parse or "-" for stdin - :type batch_file: str - :return: a dictionary representation of the input contents - :rtype: dict[int, str] + Args: + batch_file (str): name of the file to parse or "-" for stdin + + Returns: + dict[int, str]: a dictionary representation of the input contents """ dl_dict = {} -- cgit v1.2.3