Add an event handler on all objects
This commit is contained in:
parent
81f4c590bd
commit
38563a6593
4 changed files with 226 additions and 11 deletions
|
|
@ -67,7 +67,7 @@ def patch_hook(typeclass, method_name):
|
|||
inheritance tree for a couple of methods.
|
||||
|
||||
"""
|
||||
hook = getattr(typeclass, method_name)
|
||||
hook = getattr(typeclass, method_name, None)
|
||||
def wrapper(method):
|
||||
"""Wrapper around the hook."""
|
||||
def overridden_hook(*args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue