Small adjustments to API docs config (#86474)

This commit is contained in:
Franck Nijhof 2023-01-23 19:58:39 +01:00 committed by GitHub
parent e3b81ad170
commit c1332f68b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 19 deletions

View File

@ -1,21 +1,20 @@
#!/usr/bin/env python3
#
# Home-Assistant documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 13:13:10 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
"""Home Assistant documentation build configuration file.
This file is execfile()d with the current directory set to its
containing dir.
Note that not all possible configuration values are present in this
autogenerated file.
All configuration values have a default; values that are commented out
serve to show the default.
If extensions (or modules to document with autodoc) are in another directory,
add these directories to sys.path here. If the directory is relative to the
documentation root, use os.path.abspath to make it absolute, like shown here.
"""
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import inspect
import os
import sys
@ -110,17 +109,17 @@ def linkcode_resolve(domain, info):
for part in fullname.split("."):
try:
obj = getattr(obj, part)
except:
except Exception: # pylint: disable=broad-except
return None
try:
fn = inspect.getsourcefile(obj)
except:
except Exception: # pylint: disable=broad-except
fn = None
if not fn:
return None
try:
source, lineno = inspect.findsource(obj)
except:
except Exception: # pylint: disable=broad-except
lineno = None
if lineno:
linespec = "#L%d" % (lineno + 1)