skip to navigation
skip to content

Not Logged In

collective.hook 1.0b1

A very simple hook system for zope application by Makina-Corpus.

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

makinacom

Authors

Contributors

Changelog

1.0b1 (2010-05-27)

  • Initial release
 
File Type Py Version Uploaded on Size
collective.hook-1.0b1.zip (md5) Source 2010-05-27 19KB
  • Downloads (All Versions):
  • 43 downloads in the last day
  • 194 downloads in the last week
  • 573 downloads in the last month