From cdc821eb743729fe81dea573ef71091b777301c3 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Apr 2013 17:36:21 -0500 Subject: callable hook convenience functions.. now work, and with tests! - Added three "callables" test plugins. - updated callable_runone to check for unhandled_okay in the kwargs dict. All passing! --- mediagoblin/tools/pluginapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/tools/pluginapi.py') diff --git a/mediagoblin/tools/pluginapi.py b/mediagoblin/tools/pluginapi.py index f233fe51..2c0394aa 100644 --- a/mediagoblin/tools/pluginapi.py +++ b/mediagoblin/tools/pluginapi.py @@ -294,7 +294,7 @@ class UnhandledCallable(Exception): pass -def callable_runone(hookname, unhandled_okay=False, *args, **kwargs): +def callable_runone(hookname, *args, **kwargs): """ Run the callable hook HOOKNAME... run until the first response, then return. @@ -313,7 +313,7 @@ def callable_runone(hookname, unhandled_okay=False, *args, **kwargs): except CantHandleIt: continue - if unhandled_okay is False: + if kwargs.get("unhandled_okay", False) is False: raise UnhandledCallable( "No hooks registered capable of handling '%s'" % hookname) -- cgit v1.2.3