This release is a pre-release and may not be stable for production use.
Introduction
Hook is a system based on zope.event.
To make a method hookable, you first need to define an event that provide at least IHookEvent.
Next you can use collective.hook.decorator.hook(MyEventClassHook) to decorate your method.
Define a handler as usual:
- <subscriber
for=”my.module.IMyHook” handler=”my.module.my_hook” />
Warning: This event is triggered two times. So you need in your hook to check the value of before boolean attribute or after boolean attribute. The event store the result of the call in the attribute ‘returned_value’
There are also hooked_args and hooked_kwargs if you want to play with arguments.
Credits
Companies
Authors
JeanMichel FRANCOIS aka toutpt <toutpt@makina-corpus.org>
Contributors
Changelog
1.0b1 (2010-05-27)
Initial release
Release files for collective.hook 1.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| collective.hook-1.0b1.zip | 19.6 kB | Details |
Release files / collective.hook-1.0b1.zip
| Download URL | collective.hook-1.0b1.zip |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e8441ed19009712209033f5bb72a1fa0626fcd4bbb4e4755927bf3cfd059ddc
|
|
BLAKE2b-256 checksum How to use checksums |
df89339d4ac89105b22abd7c583ab9e30c1f6bfdb031f18f82b78fbd9d98f34f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |