网页
综合
更新时间 2026-11-17 02:28:09
Event Manager API — Sphinx documentation
自动蜘蛛
www.sphinx-doc.org
正文约 1688 字
Event manager for Sphinx.
Register a custom Sphinx event called name.
This is needed to be able to emit the event.
name – The name of the event.
Connect a handler to specific event.
Register callback to be called when the name event is emitted.
See event callbacks for details on available core events and the arguments of their corresponding callback functions.
name – The name of the target event.
callback – Callback function for the event.
priority – The priority of the callback. The callbacks will be invoked in ascending order of priority.
A listener ID, for use with the disconnect() method.
Changed in version 3.0: Support priority
Disconnect the handler given by listener_id.
listener_id – A listener_id previously returned by connect().
Emit a Sphinx event.
This emits the name event and passes args to the handler functions. Return the return values of all handlers as a list. Do not emit core Sphinx events in extensions!
name – The name of the event that will be emitted.
args – The arguments for the event, to be passed to the handler functions.
allowed_exceptions – The list of exceptions that are allowed in the handlers.
Changed in version 3.1: Added allowed_exceptions to specify path-through exceptions
Emit a Sphinx event and return the first result.
This emits the name event and passes args to the handler functions. The first non-None result is returned.
name – The name of the event that will be emitted.
args – The arguments for the event, to be passed to the handler functions.
allowed_exceptions – The list of exceptions that are allowed in the handlers.
Added in version 0.5.
Changed in version 3.1: Added allowed_exceptions to specify path-through exceptions
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。