(
self,
env: BuildEnvironment,
fromdocname: str,
builder: Builder,
type: str,
target: str,
node: pending_xref,
contnode: Element,
)
| 120 | class PatchedPythonDomain(PythonDomain): |
| 121 | @override |
| 122 | def resolve_xref( |
| 123 | self, |
| 124 | env: BuildEnvironment, |
| 125 | fromdocname: str, |
| 126 | builder: Builder, |
| 127 | type: str, |
| 128 | target: str, |
| 129 | node: pending_xref, |
| 130 | contnode: Element, |
| 131 | ) -> reference | None: |
| 132 | if target in public_targets: |
| 133 | target = node["reftarget"] = public_targets[target] |
| 134 | mapping = { |
| 135 | "_thread._local": ("threading.local", "local"), |
| 136 | "asyncio.events.AbstractEventLoop": ("asyncio.AbstractEventLoop", "AbstractEventLoop"), |
| 137 | "concurrent.futures._base.Executor": ("concurrent.futures.Executor", "Executor"), |
| 138 | } |
| 139 | if target in mapping: |
| 140 | of_type, with_name = mapping[target] |
| 141 | target = of_type |
| 142 | node["reftarget"] = of_type |
| 143 | contnode.replace(contnode.children[0], Text(with_name)) |
| 144 | return super().resolve_xref(env, fromdocname, builder, type, target, node, contnode) |
| 145 | |
| 146 | app.add_domain(PatchedPythonDomain, override=True) |
| 147 | app.connect("autodoc-process-bases", _public_bases) |
nothing calls this directly
no outgoing calls
no test coverage detected