From 875fd85d659fb10d978419ccad4c2584589f96f0 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Thu, 1 Sep 2022 10:51:32 +0200 Subject: [PATCH] removed types from docstrings now that we have type annotations. note, the return value still needs to be in there. --- blag/blag.py | 48 ++++++++++++++++++++++++---------------------- blag/devserver.py | 8 +++++--- blag/markdown.py | 8 +++++--- blag/quickstart.py | 8 +++++--- 4 files changed, 40 insertions(+), 32 deletions(-) diff --git a/blag/blag.py b/blag/blag.py index 8a9ce81..60fdb33 100644 --- a/blag/blag.py +++ b/blag/blag.py @@ -43,7 +43,7 @@ def main(arguments: list[str] | None = None) -> None: Parameters ---------- - arguments : list[str] + arguments optional parameters, used for testing """ @@ -60,7 +60,7 @@ def parse_args(args: list[str] | None = None) -> argparse.Namespace: Parameters ---------- - args : List[str] + args optional parameters, used for testing Returns @@ -149,7 +149,7 @@ def get_config(configfile: str) -> configparser.SectionProxy: Parameters ---------- - configfile : str + configfile path to configuration file @@ -188,8 +188,9 @@ def environment_factory( Parameters ---------- - template_dir : str - globals_ : dict[str, object] + template_dir + directory containing the templates + globals_ Returns ------- @@ -216,7 +217,7 @@ def build(args: argparse.Namespace) -> None: Parameters ---------- - args : argparse.Namespace + args """ os.makedirs(f'{args.output_dir}', exist_ok=True) @@ -290,16 +291,17 @@ def process_markdown( Parameters ---------- - convertibles : list[tuple[str, str]] + convertibles relative paths to markdown- (src) html- (dest) files - input_dir : str - output_dir : str - page_template, archive_template : jinja2 template + input_dir + output_dir + page_template, archive_template templats for pages and articles Returns ------- - articles, pages : list[tuple[str, dict[str, Any]]] + list[tuple[str, dict[str, Any]]], list[tuple[str, dict[str, Any]]] + articles and pages """ logger.info("Converting Markdown files...") @@ -346,17 +348,17 @@ def generate_feed( Parameters ---------- - articles : list[tuple[str, dict[str, Any]]] + articles list of relative output path and article dictionary - output_dir : str + output_dir where the feed is stored - base_url : str + base_url base url - blog_title : str + blog_title blog title - blog_description : str + blog_description blog description - blog_author : str + blog_author blog author """ @@ -395,11 +397,11 @@ def generate_archive( Parameters ---------- - articles : list[tuple[str, dict[str, Any]]] + articles List of articles. Each article has the destination path and a dictionary with the content. - template : jinja2.Template instance - output_dir : str + template + output_dir """ archive = [] @@ -423,11 +425,11 @@ def generate_tags( Parameters ---------- - articles : list[tuple[str, dict[str, Any]]] + articles List of articles. Each article has the destination path and a dictionary with the content. - tags_template, tag_template : jinja2.Template instance - output_dir : str + tags_template, tag_template + output_dir """ logger.info("Generating Tag-pages.") diff --git a/blag/devserver.py b/blag/devserver.py index 1f2a8be..2c31046 100644 --- a/blag/devserver.py +++ b/blag/devserver.py @@ -30,7 +30,7 @@ def get_last_modified(dirs: list[str]) -> float: Parameters ---------- - dirs : list[str] + dirs list of directories to search Returns @@ -63,7 +63,8 @@ def autoreload(args: argparse.Namespace) -> None: Parameters ---------- - args : argparse.Namespace + args + contains the input-, template- and static dir """ dirs = [args.input_dir, args.template_dir, args.static_dir] @@ -85,7 +86,8 @@ def serve(args: argparse.Namespace) -> None: Parameters ---------- - args : arparse.Namespace + args + contains the input-, template- and static dir """ httpd = HTTPServer(('', 8000), partial(SimpleHTTPRequestHandler, diff --git a/blag/markdown.py b/blag/markdown.py index efe0926..fa6d908 100644 --- a/blag/markdown.py +++ b/blag/markdown.py @@ -54,12 +54,14 @@ def convert_markdown( Parameters ---------- - md : markdown.Markdown instance - markdown : str + md + the Markdown instance + markdown + the markdown text that should be converted Returns ------- - str, dict[str, str] : + str, dict[str, str] html and metadata """ diff --git a/blag/quickstart.py b/blag/quickstart.py index cbdcaac..4f4678d 100644 --- a/blag/quickstart.py +++ b/blag/quickstart.py @@ -16,14 +16,15 @@ def get_input(question: str, default: str) -> str: Parameters ---------- - question : str + question the question the user is presented - default : str + default the default value that will be used if no answer was given Returns ------- str + the answer """ reply = input(f"{question} [{default}]: ") @@ -40,7 +41,8 @@ def quickstart(args: argparse.Namespace | None) -> None: Parameters ---------- - args : argparse.Namespace + args + not used """ base_url = get_input(