From 81a636dcf438dc369fd10109db6e50ff15674f41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Mar 2024 14:54:00 +1100 Subject: [PATCH] Cleanup: remove unused import, consistent quote style --- doc/python_api/conf.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/python_api/conf.py b/doc/python_api/conf.py index f087d00cbf6..ce5702dd16e 100644 --- a/doc/python_api/conf.py +++ b/doc/python_api/conf.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: GPL-2.0-or-later -from string import Template import time @@ -13,19 +12,19 @@ BLENDER_REVISION = "${BLENDER_REVISION}" BLENDER_REVISION_TIMESTAMP = "${BLENDER_REVISION_TIMESTAMP}" if BLENDER_REVISION != "Unknown": - # SHA1 Git hash + # SHA1 GIT hash. BLENDER_VERSION_HASH = BLENDER_REVISION BLENDER_VERSION_HASH_HTML_LINK = "%s" % ( BLENDER_VERSION_HASH, BLENDER_VERSION_HASH) BLENDER_VERSION_DATE = time.strftime("%d/%m/%Y", time.localtime(BLENDER_REVISION_TIMESTAMP)) else: - # Fallback: Should not be used + # Fallback: Should not be used. BLENDER_VERSION_HASH = "Hash Unknown" BLENDER_VERSION_HASH_HTML_LINK = BLENDER_VERSION_HASH BLENDER_VERSION_DATE = time.strftime("%Y-%m-%d") -extensions = ['sphinx.ext.intersphinx'] -intersphinx_mapping = {'blender_manual': ("https://docs.blender.org/manual/en/dev/", None)} +extensions = ["sphinx.ext.intersphinx"] +intersphinx_mapping = {"blender_manual": ("https://docs.blender.org/manual/en/dev/", None)} project = "Blender %s Python API" % BLENDER_VERSION_STRING root_doc = "index" copyright = "Blender Authors" @@ -33,9 +32,9 @@ version = BLENDER_VERSION_DOTS release = BLENDER_VERSION_DOTS # Set this as the default is a super-set of Python3. -highlight_language = 'python3' +highlight_language = "python3" # No need to detect encoding. -highlight_options = {'default': {'encoding': 'utf-8'}} +highlight_options = {"default": {"encoding": "utf-8"}} # Quiet file not in table-of-contents warnings. exclude_patterns = [ @@ -44,8 +43,8 @@ exclude_patterns = [ html_title = "Blender Python API" -# The fallback to a built-in theme when furo is not found. -html_theme = 'default' +# The fallback to a built-in theme when `furo` is not found. +html_theme = "default" try: import furo @@ -73,7 +72,7 @@ if html_theme == "furo": ] } -# not helpful since the source is generated, adds to upload size. +# Not helpful since the source is generated, adds to upload size. html_copy_source = False html_show_sphinx = False html_baseurl = "https://docs.blender.org/api/current/" @@ -88,16 +87,18 @@ html_favicon = "static/favicon.ico" html_logo = "static/blender_logo.svg" # Disable default `last_updated` value, since this is the date of doc generation, not the one of the source commit. html_last_updated_fmt = None -if html_theme == 'furo': +if html_theme == "furo": html_css_files = ["css/theme_overrides.css", "css/version_switch.css"] html_js_files = ["js/version_switch.js"] -# needed for latex, pdf gen +# Needed for latex, PDF generation. latex_elements = { - 'papersize': 'a4paper', + "papersize": "a4paper", } -latex_documents = [("contents", "contents.tex", "Blender Index", "Blender Foundation", "manual"), ] +latex_documents = [ + ("contents", "contents.tex", "Blender Index", "Blender Foundation", "manual"), +] # Workaround for useless links leading to compile errors # See https://github.com/sphinx-doc/sphinx/issues/3866 @@ -106,8 +107,8 @@ from sphinx.domains.python import PythonDomain class PatchedPythonDomain(PythonDomain): def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): - if 'refspecific' in node: - del node['refspecific'] + if "refspecific" in node: + del node["refspecific"] return super(PatchedPythonDomain, self).resolve_xref( env, fromdocname, builder, typ, target, node, contnode)