(self, name, func)
Attach a callback to a hook.
Attach a callback to a hook.
Attach a callback to a hook .
def add(self, name, func):
        ''' Attach a callback to a hook. '''
        was_empty = self._empty()
        self.hooks.setdefault(name, []).append(func)
        if self.app and was_empty and not self._empty(): self.app.reset()
def add ( self , name , func ) : was_empty = self . _empty ( ) self . hooks . setdefault ( name , [ ] ) . append ( func ) if self . app and was_empty and not self . _empty ( ) : self . app . reset ( )