diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-04-10 17:36:21 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-04-10 17:36:21 -0500 |
commit | cdc821eb743729fe81dea573ef71091b777301c3 (patch) | |
tree | 8d64b211e7e1dc17c82b935eba525dee13b89d91 /mediagoblin/tools/pluginapi.py | |
parent | 70c061955c56d62956d707a0828ca2f1dc059aad (diff) | |
download | mediagoblin-cdc821eb743729fe81dea573ef71091b777301c3.tar.lz mediagoblin-cdc821eb743729fe81dea573ef71091b777301c3.tar.xz mediagoblin-cdc821eb743729fe81dea573ef71091b777301c3.zip |
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!
Diffstat (limited to 'mediagoblin/tools/pluginapi.py')
-rw-r--r-- | mediagoblin/tools/pluginapi.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |