mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix docs of emit_firstresult().
This commit is contained in:
@@ -269,8 +269,7 @@ the following public API:
|
||||
.. method:: Sphinx.emit_firstresult(event, *arguments)
|
||||
|
||||
Emit *event* and pass *arguments* to the callback functions. Return the
|
||||
result of the first callback that doesn't return ``None`` (and don't call
|
||||
the rest of the callbacks).
|
||||
result of the first callback that doesn't return ``None``.
|
||||
|
||||
.. versionadded:: 0.5
|
||||
|
||||
|
||||
@@ -274,11 +274,11 @@ class Sphinx(object):
|
||||
event.pop(listener_id, None)
|
||||
|
||||
def emit(self, event, *args):
|
||||
result = []
|
||||
results = []
|
||||
if event in self._listeners:
|
||||
for _, callback in self._listeners[event].iteritems():
|
||||
result.append(callback(self, *args))
|
||||
return result
|
||||
results.append(callback(self, *args))
|
||||
return results
|
||||
|
||||
def emit_firstresult(self, event, *args):
|
||||
for result in self.emit(event, *args):
|
||||
|
||||
Reference in New Issue
Block a user