Fix docs of emit_firstresult().

This commit is contained in:
Georg Brandl
2010-01-14 11:18:28 +01:00
parent 6ae7e196c3
commit ba13060ebe
2 changed files with 4 additions and 5 deletions

View File

@@ -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

View File

@@ -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):