Source code for pytapable.intercept_base



[docs]class HookInterceptor(object): """ Interceptors allow you to intercept actions that are being performed on hooks and optionally modify it """
[docs] def create(self, hook): """ Triggered when a hook has been initialized Args: hook (BaseHook): The hook that was created """ pass
[docs] def register(self, context, tap): """ Triggered for each added tap and allows you to modify the tap .. code-block:: python context = { 'hook': BaseHook, # The hook that's being tapped } Args: context (dict) tap (Tap): The Tap that is going to be installed on the hook Returns: modified_tap (Tap): The Tap to install on the hook """ return tap