From 158d0fa384f2106ba99ba2d820d6e16efb5b5a71 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:10:35 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rst/qgis_pydoc_template.txt | 1 - scripts/make_api_rst.py | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rst/qgis_pydoc_template.txt b/rst/qgis_pydoc_template.txt index a4817298ecdc..66423a0f5145 100644 --- a/rst/qgis_pydoc_template.txt +++ b/rst/qgis_pydoc_template.txt @@ -14,4 +14,3 @@ $HEADER_CONTENT :exclude-members: $EXCLUDE_METHODS $TABLE_OF_CONTENTS - diff --git a/scripts/make_api_rst.py b/scripts/make_api_rst.py index 07c589073ff8..d9e74db26253 100755 --- a/scripts/make_api_rst.py +++ b/scripts/make_api_rst.py @@ -85,6 +85,7 @@ class RecursiveTemplate(Template): """ Template subclass which performs recursive substitution on a string. """ + def __init__(self, template): super().__init__(template) self.depth = 0 @@ -101,7 +102,7 @@ def _recursive_substitute(self, **kws): self.depth += 1 result = super().safe_substitute(**kws) - if '$' in result: + if "$" in result: return self.__class__(result)._recursive_substitute(**kws) return result @@ -296,8 +297,8 @@ def generate_docs(): for class_name, _class in extract_package_classes(package): exclude_methods = set() - header = '' - toc = '' + header = "" + toc = "" for method in dir(_class): if not hasattr(_class, method): continue @@ -333,7 +334,7 @@ def generate_docs(): "CLASS": class_name, "EXCLUDE_METHODS": ",".join(exclude_methods), "HEADER_CONTENT": header, - "TABLE_OF_CONTENTS": toc + "TABLE_OF_CONTENTS": toc, } class_template = template.substitute(**substitutions) class_rst = open(f"api/{qgis_version}/{package_name}/{class_name}.rst", "w")