Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and nyalldawson committed Aug 21, 2024
1 parent 0c4c44d commit 158d0fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion rst/qgis_pydoc_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ $HEADER_CONTENT
:exclude-members: $EXCLUDE_METHODS

$TABLE_OF_CONTENTS

9 changes: 5 additions & 4 deletions scripts/make_api_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 158d0fa

Please sign in to comment.