From: Adam Sampson Date: Tue, 21 Dec 2004 18:48:00 +0000 (+0000) Subject: Make call_hook return a useful value. X-Git-Tag: v2.2rc1~31 X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=f8c23f66d083f21266c9522f71655d198c415f72;p=rawdog%2F.git Make call_hook return a useful value. --- diff --git a/rawdoglib/plugins.py b/rawdoglib/plugins.py index 0e3d276..eb81c94 100644 --- a/rawdoglib/plugins.py +++ b/rawdoglib/plugins.py @@ -56,8 +56,10 @@ def attach_hook(hookname, func): def call_hook(hookname, *args): """Call all the functions attached to a hook with the given arguments, in the order they were added, stopping if a hook function - returns False.""" + returns False. Returns True if any hook function returned False (i.e. + returns True if any hook function handled the request).""" for func in attached.get(hookname, []): if not func(*args): - break + return True + return False