From f8c23f66d083f21266c9522f71655d198c415f72 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 21 Dec 2004 18:48:00 +0000 Subject: [PATCH] Make call_hook return a useful value. --- rawdoglib/plugins.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.35.1