GH-103082: Clean up the sys.monitoring docs (GH-110532)

This commit is contained in:
Tian Gao 2023-10-18 16:15:42 -07:00 committed by GitHub
parent 94495d0387
commit 1991694117
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 165 additions and 101 deletions

View file

@ -607,6 +607,13 @@ def parse_pdb_command(env, sig, signode):
return fullname
def parse_monitoring_event(env, sig, signode):
"""Transform a monitoring event signature into RST nodes."""
signode += addnodes.desc_addname('sys.monitoring.events.', 'sys.monitoring.events.')
signode += addnodes.desc_name(sig, sig)
return sig
def process_audit_events(app, doctree, fromdocname):
for node in doctree.traverse(audit_event_list):
break
@ -707,6 +714,7 @@ def setup(app):
app.add_builder(PydocTopicsBuilder)
app.add_object_type('opcode', 'opcode', '%s (opcode)', parse_opcode_signature)
app.add_object_type('pdbcommand', 'pdbcmd', '%s (pdb command)', parse_pdb_command)
app.add_object_type('monitoring-event', 'monitoring-event', '%s (monitoring event)', parse_monitoring_event)
app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
app.add_directive_to_domain('py', 'coroutinefunction', PyCoroutineFunction)