home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from __future__ import with_statement
- from peak.util.plugins import Hook
- from traceback import print_exc
- __all__ = [
- 'register',
- 'reduce',
- 'foldl']
-
- def register(hook_identifier, cb):
- return Hook(hook_identifier).register(cb)
-
-
- def reduce(hook_identifier, arg, raise_exceptions = False):
- for hook in Hook(hook_identifier):
- if raise_exceptions:
- arg = hook(arg)
- continue
-
- try:
- arg = hook(arg)
- continue
- except Exception:
- print_exc()
- continue
-
-
-
- return arg
-
- foldl = reduce
-