From 63df67acea19b3708d34ef3b656c1b784c2a72f4 Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 7 Jun 2024 21:36:34 +0800 Subject: refactor: numerous improvements (#32) --- scripts/build-declarations.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/build-declarations.py') diff --git a/scripts/build-declarations.py b/scripts/build-declarations.py index 2a28e43..2157c88 100644 --- a/scripts/build-declarations.py +++ b/scripts/build-declarations.py @@ -9,8 +9,11 @@ from collections import OrderedDict TOOL_ENTRY_FUNC = "run" -def main(is_tool = True): + +def main(is_tool=True): scriptfile = sys.argv[1] + is_tool = os.path.dirname(scriptfile) == "tools" + with open(scriptfile, "r", encoding="utf-8") as f: contents = f.read() @@ -92,8 +95,8 @@ def parse_docstring(docstring: str): break params = {} for rawParam in rawParams: - name, type_, description = parse_param(rawParam) - params[name] = (type_, description) + name, type_, param_description = parse_param(rawParam) + params[name] = (type_, param_description) return (description.strip(), params) -- cgit v1.2.3